【问题标题】:Android Studio 3.1, No cached version available for offline modeAndroid Studio 3.1,没有可用于离线模式的缓存版本
【发布时间】:2018-03-27 11:19:04
【问题描述】:

升级到 Android Studio 3.1 后的大问题,我得到:

No cached version of com.github.bumptech.glide:compiler:4.6.1 available for offline mode

但我没有处于离线模式,如您在此处看到的:

我尝试了 Clean Project 和 Rebuild Project,但均未成功。 我什至重新启动了我的电脑。

这是我的 Build.gradle:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation "com.android.support:gridlayout-v7:27.1.0"
    implementation 'com.android.support:exifinterface:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.code.gson:gson:2.8.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
}

【问题讨论】:

标签: android android-studio gradle offline android-glide


【解决方案1】:

我遇到了这个问题,并且在 gradle 设置中未选中“离线工作”。在浪费了 2 个小时之后,我意识到我在 Build、Execution、Deployment > Compiler 的命令行选项中有 --offline。因此,当您遇到此问题时,请确保您没有在此处列出该命令。

【讨论】:

【解决方案2】:

你应该关闭 Gradle 离线工作模型并清除编译器命令行选项 --offline:

【讨论】:

    【解决方案3】:

    唯一对我有用的是删除“文件->设置->编译器->命令行选项”中的“--offline”。

    我不知道为什么会有这个参数,但无论如何……现在没问题了。

    【讨论】:

      【解决方案4】:

      不知道发生了什么,也许真的是因为 JCenter 在白天部分停机。可能是因为全球一半的人都在将 Android Studio 升级到 3.1。

      我清理了缓存(70.000 个文件!),没有任何效果,除了一个小时的数千个文件的下载,主要来自 JCenter,在此过程中至少有 10 次失败(超时?)。 最终结果:Gradle 还在抱怨

      No cached version of com.github.bumptech.glide:compiler:4.6.1 available for offline mode
      

      然后无奈之下,我修改了

      annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
      

      `compile group: 'com.github.bumptech.glide', name: 'compiler', version:` '4.6.1'
      

      在我的 Build.gradle 中。

      结果当然是一条错误消息。

      然后又变回我原来的地方

      compile group: 'com.github.bumptech.glide', name: 'compiler', version: '4.6.1'
      

      Bingo:一切都很好,不知道为什么。

      感谢您的帮助

      【讨论】:

      • 改回?
      • 返回编译组:'com.github.bumptech.glide',名称:'compiler',版本:'4.6.1'
      【解决方案5】:

      首先我的英语很差,对不起。 我也遇到了这个问题,当我将我的AndroidStudio升级到3.1并将gradle 3.0.1更新到3.1.0,然后我构建运行我的项目,它是错误“离线模式下没有butterknife版本”,但我确定这不是离线模式。我尝试了很多方法,都不行。 然后我尝试在AndroidStudio中添加依赖ProjectStructure--app--dependences,搜索并选择butterknife,然后构建运行。 有用! https://blog.csdn.net/binglumeng/article/details/79747651 希望对你有帮助!

      【讨论】:

        【解决方案6】:

        您是否尝试过使缓存无效并重新启动您的 android studio? 否则,如果您在代理网络后面工作,请查看此 link

        【讨论】:

        • 是的,尝试删除缓存(70k 个文件!)。不幸的是,这并没有改变结果。还是谢谢
        猜你喜欢
        • 2014-05-01
        • 2016-09-21
        • 1970-01-01
        • 2018-01-08
        • 2017-08-19
        • 1970-01-01
        • 2020-09-13
        • 1970-01-01
        • 2017-12-22
        相关资源
        最近更新 更多