android - 错误:找不到符号类 GlideBitmapDrawable
问题描述
嗨,我收到错误消息:当我尝试在 android studio 中编译项目时,找不到符号类 GlideBitmapDrawable。如何解决错误。
我在 module:app 中添加了这三个依赖项
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation "com.github.bumptech.glide:okhttp3-integration:4.0.0-RC1"
我在 GlideBitmapDrawable 的导入语句和代码中到达这里
import com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable;
try {
GlideBitmapDrawable drawable = (GlideBitmapDrawable) photoView.getDrawable();
bitmap = drawable.getBitmap();
}
有人可以建议其中缺少什么吗?
解决方案
你需要使用
BitmapDrawable.
代替
GlideBitmapDrawable
来自 glide 的文档
GlideDrawable
在 Glide v3 中已删除以支持标准 AndroidDrawable
。GlideBitmapDrawable
已被删除以支持BitmapDrawable
。
欲了解更多信息,请阅读阅读Glide Drawables
推荐阅读
- spring-boot - 一对一映射 Spring Data JPA
- git - PR 的 GIT 提交消息
- reactjs - 为 14 位数字创建掩码
- python - Flask 通用异常处理程序无法捕获 405 错误
- weka - 如何将 AdTree 和 BfTree 算法导入 Weka App?
- javascript - React(Nextjs):将表格行渲染为boostrap modal onclick
- cmake - 如何知道 add_custom_command 的 post_build 风格是否成功?
- c++ - 如何将 Varadic 模板化为模板中的返回类型?
- swift - 修改控制器每秒将一些数据写入日志文件
- php - Wordpress - 仅在使用标签时在更多标签之前显示内容