(Build Tools -> Gradle)Then (uncheck -> Offline work) on the right. Click the OK button.
If we need to use the offline mode, just go to the Gradle window and click the Toggle Offline Mode button: After we click the button to enable offline mode, we can reload all dependencies and find that offline mode works.
By default, Gradle connects to remote repositories and checks for updates on every launch. Resolving Gradle dependencies can require downloading new artifacts. You can switch to offline mode if you want Gradle to use only those resources that are available locally.
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
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
[
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".
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.
@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
.
Offline mode could be set in Android Studio and in your project. To verify that gradle won't build your project in offline mode:
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