Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No cached version of com.android.tools.build:gradle:1.2.3 available for offline mode

I installed JetBrains IDEA 15.0.2 with android support on my computer that is disconnected from Internet. After that the project sync give an error that gradle is not existed, so I solve the problem by downloading gradle 2.2.1 and extracting it in its corresponding position But after that a new sync error occurs that say "No cached version of com.android.tools.build:gradle:1.2.3 available for offline mode" How can I solve error, at the same time keeping my conputer disconnected from Internet

like image 488
Moussawi Avatar asked Dec 16 '15 09:12

Moussawi


People also ask

How do I enable Gradle offline mode?

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.

Does Gradle build require Internet connection?

Gradle needs an internet connection to download the dependencies that you specify. Once it downloads everything, it can put them in memory so that you can work offline. To do this, you need to go to Files->Settings (For Mac: Android Studio-> Settings...). You can now build your project without internet.

How do I turn off offline mode in Intellij?

Go to Preferences -> Build,Execution,Deployment -> Build Tools -> Maven Uncheck the Work Offline option. To find it quickly: Open the settings and search for "offline".


2 Answers

Try the following steps:

  1. Un-check "Offline work" in File>Settings>Gradle>Global Gradle Settings
  2. Re-sync the project, for example by restarting the Android Studio
  3. Once synced, you can check the option again to work offline.
like image 102
Ashutosh Jindal Avatar answered Sep 16 '22 11:09

Ashutosh Jindal


I faced similar kind of issue in android studio because its also uses the gradle so my problem was app's source code was written in old version of gradle but i have the latest android studio with latest gradle. so changed the classpath dependency to have latest gradle version

Update the Classpath under dependency in build.gradle file at project level from

dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
}

to

dependencies {
            classpath 'com.android.tools.build:gradle:2.1.0'

            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
    }
like image 22
Rohit Luthra Avatar answered Sep 16 '22 11:09

Rohit Luthra