【问题标题】:No cached version of com.android.tools.build:gradle:1.2.3 available for offline mode没有可用于离线模式的 com.android.tools.build:gradle:1.2.3 缓存版本
【发布时间】:2015-12-16 09:59:59
【问题描述】:

我在与 Internet 断开连接的计算机上安装了支持 android 的 JetBrains IDEA 15.0.2。 之后项目同步报gradle不存在的错误,所以我通过下载gradle 2.2.1并解压到对应位置来解决问题 但在那之后,会出现一个新的同步错误,上面写着“没有 com.android.tools.build:gradle:1.2.3 的缓存版本可用于离线模式” 如何解决错误,同时让我的计算机与 Internet 断开连接

【问题讨论】:

    标签: android intellij-idea gradle android-gradle-plugin build.gradle


    【解决方案1】:

    尝试以下步骤:

    1. 在“文件”>“设置”>“Gradle”>“全局 Gradle 设置”中取消选中“离线工作”
    2. 重新同步项目,例如重启 Android Studio
    3. 同步后,您可以再次选中该选项以脱机工作。

    【讨论】:

      【解决方案2】:

      我在 android studio 中遇到过类似的问题,因为它也使用 gradle,所以我的问题是应用程序的源代码是用旧版本的 gradle 编写的,但我有最新的 android studio 和最新的 gradle。所以将类路径依赖项更改为具有最新的 gradle 版本

      在项目级别更新 build.gradle 文件中依赖项下的 Classpath 来自

      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
      }
      

      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
          }
      

      【讨论】:

      • 你没有 IntelliJ Idea 吗?我想他是在要求它。
      猜你喜欢
      • 2017-08-19
      • 2017-03-11
      • 2018-03-15
      • 2014-05-01
      • 2016-09-21
      • 2020-09-13
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      相关资源
      最近更新 更多