首页 > 解决方案 > 在 glide 库 v4.8.0 中没有缓存版本的 xxxcompiler:4.8.0 可用于离线模式错误

问题描述

我成功地将 glide 4.8.0 库添加到我的 android studio 项目中。但是当我检查 gradle 离线工作并运行项目时,我遇到了这个错误:

“没有可用于离线模式的 com.github.bumptech.glide:compiler:4.8.0 的缓存版本”。禁用 Gradle“离线模式”并同步项目

我希望 gradle 保持离线工作模式。我在 build.gradle(app level) 中将 glide 库添加到我的项目中,如下所示:

    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

build.gradle 的项目级别是:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

标签: androidandroid-glide

解决方案


您是否尝试过禁用离线模式然后重新构建,构建完成后您再次启用离线模式。


推荐阅读