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.
(Build Tools -> Gradle)Then (uncheck -> Offline work) on the right. Click the OK button. Then Rebuild the Project.
You can enable from File->Build, Execution, Deployment->Build Tools-> Gradle-> Offline Work.
Had the same error after updating Android Studio today. For me, it wasn't a matter of proxy settings:
Uncheck "Offline work" in Android Studio 0.6.0:
File->Settings->Gradle->Global Gradle Settings
or in OSX:
Preferences->Gradle->Global Gradle Setting
or in more recent versions:
File->Settings->Build, Execution, Deployment->Build tools->Gradle
Resync the project, for example by restarting the Android Studio
(Only tested in Gradle version 0.11... and Android Studio version 0.6.0 Preview)
EDIT : Added paths for different versions/platforms (as mentioned by John Ballinger and The_Martian). Not yet verified.
With the new Android Studio 3.6 to toggle Gradle's offline mode go to View
> Tool Windows
> Gradle
from the menu bar and toggle the value of Offline Mode that is near the top of the Gradle window.
Please follow below steps :
1.Open Your project.
2.Go to the Left side of the Gradle button.
3.Look at below image.
4.Click button above image show.
5.if this type of view you are not in offline mode.
6.Go to Build and rebuild the project.
All above point is work for me.
Just happened to me after upgrading to Android Studio 3.1. The Offline Work checkbox was unchecked, so no luck there.
I went to Settings > Build, Execution, Deployment > Compiler
and the Command-line Options
textfield contained --offline
, so I just deleted that and everything worked.
I had same error...Please Uncheck the offline work in Settings.
File => Settings => Build, Execution, Deployment => Build Tools => Gradle => Offline Work
After Gradle Sync Finished, Please Restart Your Android Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With