如何使 GlideApp 与 androidx 兼容?
How do I make GlideApp Compatible with androidx?
我最近将我的应用程序从 AppCompat 迁移到 Androidx,但现在我遇到了 GlideApp 的严重问题。每当我尝试构建项目时,它都会显示编译失败。
我尝试更改以下导入语句,
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
在构建文件夹中:
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
但是每当我重建它时,它只会重新生成以前的导入语句和returns以下错误:
error: package android.support.annotation does not exist error:
cannot find symbol class NonNull
我通过将 annotationProcessor 'androidx.annotation:annotation:1.1.0'
添加到应用程序 build.gradle 中的依赖项中找到了修复,并且能够正确构建项目。
从这里得到解决方案:https://github.com/bumptech/glide/issues/3080#issuecomment-426331231
我最近将我的应用程序从 AppCompat 迁移到 Androidx,但现在我遇到了 GlideApp 的严重问题。每当我尝试构建项目时,它都会显示编译失败。
我尝试更改以下导入语句,
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
在构建文件夹中:
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
但是每当我重建它时,它只会重新生成以前的导入语句和returns以下错误:
error: package android.support.annotation does not exist error: cannot find symbol class NonNull
我通过将 annotationProcessor 'androidx.annotation:annotation:1.1.0'
添加到应用程序 build.gradle 中的依赖项中找到了修复,并且能够正确构建项目。
从这里得到解决方案:https://github.com/bumptech/glide/issues/3080#issuecomment-426331231