android运行时错误。报错如下:
java.lang.NoSuchMethodError: No virtual method diskCacheStrategy(Lcom/bumptech/glide/load/engine/DiskCacheStrategy;)Lcom/bumptech/glide/request/BaseRequestOptions; in class Lcom/bumptech/glide/request/RequestOptions; or its super classes (declaration of 'com.bumptech.glide.request.RequestOptions' appears in /data/app/com.dlc.mytestttt-2/base.apk)
解决方法:
错误原因
glide版本不一致
跟换版本即可
implementation 'com.github.bumptech.glide:glide:4.6.1'
//glide
// implementation 'com.github.bumptech.glide:glide:4.9.0'
本文详细解析了在Android开发中遇到的Glide版本不一致导致的运行时错误问题,并提供了具体的解决方案,通过更换Glide版本至4.6.1或4.9.0,可以有效避免NoSuchMethodError异常。

被折叠的 条评论
为什么被折叠?



