Android Studio 3.1,离线模式下无缓存版本可用

3
自从升级到Android Studio 3.1以来,我遇到了一个大问题,错误信息如下:
No cached version of com.github.bumptech.glide:compiler:4.6.1 available for offline mode

但是如您所见,我并没有处于离线模式:

enter image description here

我尝试了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'
}

请查看此链接:https://dev59.com/Q1UL5IYBdhLWcg3w-sR4#49506100 - KuLdip PaTel
谢谢KuLdip,但我已经有了Gradle-awake Make条目。 - j3App
JCenter从Bintray目前已经下线。也许你的问题与此有关?-> http://status.bintray.com/ - Christopher
6个回答

7

我遇到了这个问题,gradle设置里的"离线工作"未勾选。浪费了2个小时后,我意识到在Build, Execution, Deployment > Compiler的命令行选项中有--offline。所以当你遇到这个问题时,请确保你没有在那里列出这个命令。


尝试这个答案 ➡️ https://stackoverflow.com/questions/60481987/no-cached-version-gradle-plugin-available-for-offline-mode/60500279#60500279 - Mujahid Khan

4
您应该关闭Gradle离线工作模式并清除编译器命令行选项--offline: 清除命令行选项 切换离线Gradle

2
唯一有效的方法是在“文件 -> 设置 ->编译器 -> 命令行选项”中删除“--offline”。我不知道为什么需要此参数,但是现在问题已经解决了。

1

我不知道发生了什么事,也许是因为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'

to

`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'

好的,一切都很顺利,不知道为什么。

无论如何,感谢您的帮助。


更改回去? - Jason
返回编译组:'com.github.bumptech.glide',名称:'compiler',版本:'4.6.1' - j3App

1

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


0

你尝试过清除缓存并重新启动Android Studio吗? 或者如果你在代理网络后面工作,请检查这个 链接


是的,我尝试删除缓存(70k个文件!)。不幸的是,它并没有改变结果。无论如何还是谢谢。 - j3App

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接