How to disable gradle 'offline mode' in android studio?

AndroidAndroid StudioIdeAndroid Gradle-Plugin

Android Problem Overview


I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error..

> No cached version of com.android.tools.build:gradle:1.1.0 available > for offline mode. Disable Gradle 'offline mode' and sync project.

How can I solve this problem.

Android Solutions


Solution 1 - Android

New location in Android Studio 3.6+

View > Tool Windows > Gradle from the menu bar.

Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.


Old answer

On Windows:-

Go to File -> Settings.

And open the 'Build,Execution,Deployment'. Then open the

Build Tools -> Gradle

Then uncheck -> Offline work on the right.

Click the OK button.

Then Rebuild the Project.

On Mac OS:-

go to Android Studio -> Preferences, and the rest is the same. OR follow steps given in the image

[For Mac go 1

enter image description here

Solution 2 - Android

Gradle is in offline mode, which means that it won't go to the network to resolve dependencies.

Go to Preferences > Gradle and uncheck "Offline work".

Solution 3 - Android

Edit. As noted in the comments, this is no longer working with the latest Android Studio releases.

The latest Android studio seems to only reference to "Offline mode" via the keymap, but toggling this does not seem to change anything anymore.


In Android Studio open the settings and search for offline it will find the Gradle category which contains Offline work. You can disable it there.

Gradle Offline work

Solution 4 - Android

@mikepenz has the right one.

You could just hit SHIFT+COMMAND+A (if you're using OSX and 1.4 android studio) and enter OFFLINE in the search box.

Then you'll see what mike have shown you.

Just deselect offline.

Solution 5 - Android

Offline mode could be set in Android Studio and in your project. To verify that gradle won't build your project in offline mode:

  1. Disable gradle offline mode in Android Studio gradle settings.
  2. Verify that your project's gradle.settings won't contain: startParameter.offline=true

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLoganathanView Question on Stackoverflow
Solution 1 - Android独步清风View Answer on Stackoverflow
Solution 2 - AndroidScott BartaView Answer on Stackoverflow
Solution 3 - AndroidmikepenzView Answer on Stackoverflow
Solution 4 - AndroidJdi.ZhangView Answer on Stackoverflow
Solution 5 - Androidox_View Answer on Stackoverflow