Android Studio 3.1,没有可用于离线模式的缓存版本

问题描述 投票:2回答:6

自升级到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'
}
android android-studio gradle offline android-glide
6个回答
4
投票

我遇到了这个问题,并且在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'

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

宾果:一切都很好,不明白为什么。

还是要谢谢你的帮助


1
投票

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


1
投票

您应该关闭Gradle offline-work模型并清除编译器命令行选项--offline:

Clear command line option

Toggle offline Gradle


0
投票

你有没有尝试使你的缓存无效并重新启动你的Android工作室?或者,如果您在代理网络后面工作,请查看此 link


0
投票

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

我不知道为什么这个参数在那里,但无论如何......现在没关系。

© www.soinside.com 2019 - 2024. All rights reserved.