No field mMaxWidth in class Landroid/widget/ImageView
Asked Answered
T

2

11

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 ?

Tinner answered 22/4, 2020 at 11:6 Comment(1)
github.com/nostra13/Android-Universal-Image-Loader/issues/1343. Move to glideKhanate
T
3

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.

Tinner answered 27/4, 2020 at 6:50 Comment(1)
Works fine as expected, since 2019 I facing this issue while loading the image in recycler view.Deadbeat
A
14

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'
Aftergrowth answered 6/8, 2020 at 8:32 Comment(1)
This solution work and is same as this comment in GitHub.Lutestring
T
3

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.

Tinner answered 27/4, 2020 at 6:50 Comment(1)
Works fine as expected, since 2019 I facing this issue while loading the image in recycler view.Deadbeat

© 2022 - 2024 — McMap. All rights reserved.