最新版本的 Glide 给出依赖错误

Latest version of Glide giving dependency error

我已经将 Glide 的版本从 4.0.0-RC0 升级到 4.4.0。但它给我一个错误说

Error:Module 'com.github.bumptech.glide:glide:4.4.0' depends on one or more Android Libraries but is a jar

它没有说明是哪个 jar 或任何其他信息。 有人知道如何解决这个问题吗?我还在 build.gradle

中附加了 Glide 的条目
compile 'com.github.bumptech.glide:glide:4.4.0'
compile 'com.github.bumptech.glide:okhttp3-integration:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
compile 'com.github.bumptech.glide:annotations:4.4.0'

编辑:我使用的是支持库版本 27.0.1

您可以在构建中像这样使用它。只需:

dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}

这可能是 glide 问题,所以我宁愿到现在都不要将 glide 更新到 com.github.bumptech.glide:glide:4.4.0。您可以使用旧版本,例如 com.github.bumptech.glide:glide:4.3.1com.github.bumptech.glide:glide:4.3.0com.github.bumptech.glide:glide:4.2.0

您可以在

上阅读有关这些问题的更多信息

issue 2318

issue 2319

我遇到了同样的问题,但使用这个解决了它:

compile('com.github.bumptech.glide:glide:4.4.0@aar') {
    transitive = true;
}

要引入包含@GlideModule 的注释模块,您必须使用transitive = true

只需执行以下步骤即可避免此错误:

1 - 将您的 SDK 版本更新为 27

2 - 在 build.gradle 中的依赖项中:

implementation('com.github.bumptech.glide:glide:4.6.1') {
    exclude group: "com.android.support"
}

你很高兴,因为这个解决了我的问题。

implementation 'com.github.bumptech.glide:glide:4.0.0-RC0'

检查最新 android studio 3.0.2 的依赖项后,此依赖项构建正确 gradle。

只需在 app.gradle 中使用它即可:

compile 'com.github.bumptech.glide:glide:3.7.0'