Ayodele Kayode
Ayodele Kayode

Reputation: 314

Updating to new Android studio 3.1.2

I just updated my Android studio and I am get this annoying error

Error: Could not download builder.jar (com.android.tools.build:builder:3.1.2): No cached version available for offline mode

Upvotes: 1

Views: 2834

Answers (1)

Khemraj Sharma
Khemraj Sharma

Reputation: 58934

This error telling that gradle does not have offline files for com.android.tools.build:builder:3.1.2 and could not be downloaded in offline mode. So you will disable offline mode of android studio.

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.

For Mac go to AndroidStudio -> Preferences, rest is same.

Here you go.

What is offline mode :

Now let' talk about offline mode, if you want to work offline, you can check the offline mode in the settings. If you have checked this option, Gradle will use the cache for dependency resolution. If the files are not there in the cache, then it will result in a build error. You might get some errors, if you add some dependency, Gradle will not be able to resolve it since it's going to look into the cache itself.You might see a failed to sync error. In case you receive this error. Just uncheck the offline mode and sync again and then check the offline mode again. Completely offline work is very difficult with the gradle system if you have to keep adding dependencies.

Upvotes: 3

Related Questions