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

橙三吉。 提交于 2019-12-06 23:32:06

问题


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


回答1:


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.



回答2:


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
    }


来源:https://stackoverflow.com/questions/34308889/no-cached-version-of-com-android-tools-buildgradle1-2-3-available-for-offline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!