Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No field mMaxWidth in class Landroid/widget/ImageView

I used UniversalImageLoader (displayImage method) for loading image

But it throws NoSuchFieldException exception :

No field mMaxWidth in class Landroid/widget/ImageView; (declaration of 'android.widget.ImageView' appears in /system/framework/framework.jar!classes3.dex)

How to fix ?

like image 502
mohammad jalili Avatar asked Apr 22 '20 11:04

mohammad jalili


Video Answer


2 Answers

Issue fixed but not updated in gradle version.

Solution 1 :

For now don't use

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

or

.jar file

You can download library as zip and add manually as module. I am facing same issue, but this is worked in my case.

For file changes you can check this commit: f6a9615

Solution 2 :

You can use this commit using JitPack:

In your build.gradle (app level) file, add:

repositories {
    maven { url "https://jitpack.io" }
}

And replace

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' with:

implementation 'com.github.nostra13:Android-Universal-Image-Loader:f6a9615868482672c3630cb7db6dcf43391e80de'
like image 102
Govinda Paliwal Avatar answered Nov 15 '22 00:11

Govinda Paliwal


After many researches, It seems that the bug is shown in android 10 or greater. as discussed below :

https://github.com/nostra13/Android-Universal-Image-Loader/issues/1343

So I moved to Glide library until it's later fixes.

like image 41
mohammad jalili Avatar answered Nov 15 '22 00:11

mohammad jalili