类L安卓/widget/ImageView中没有字段mMaxWidth
我使用UniversalImageLoader
(displayImage
方法)加载图像
但它抛出NoSuchFieldException
异常:
No field mMaxWidth in class L安卓/widget/ImageView; (declaration of '安卓.widget.ImageView' appears in /system/framework/framework.jar!classes3.dex)
如何修复
# 1 楼答案
经过多次研究,该漏洞似乎出现在android 10或更高版本中。 如下所述:
https://github.com/nostra13/Android-Universal-Image-Loader/issues/1343
所以我转移到Glide库,直到它被修复
# 2 楼答案
问题已修复,但未在gradle版本中更新
解决方案1:
暂时不要使用
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
或
您可以将库作为zip下载,并作为模块手动添加。 我面临着同样的问题,但这在我的情况下是有效的
对于文件更改,您可以检查此提交:f6a9615
解决方案2:
您可以使用JitPack使用此提交:
在你的身体里。gradle(应用程序级)文件,添加:
替换
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
与: