Home » Android » intellij idea – No cached version of com.android.tools.build:gradle:1.2.3 available for offline mode

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

Posted by: admin June 15, 2020 Leave a comment

Questions:

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

How to&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.

Answer:

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
    }