Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glide 4.10.0 : java.lang.IllegalStateException: GeneratedAppGlideModuleImpl is implemented incorrectly

I am getting error while using Glide 4.10.0

This is the error

java.lang.IllegalStateException: GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.

like image 222
Mohd Naushad Avatar asked Oct 03 '19 15:10

Mohd Naushad


4 Answers

First thing:

Have you changed annotationProcessor dependency:

implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'

Also, it is critical that implementation & annotationProcessor version number is the same. Gradle will update the first automatically but not the second.

Second things:

Have you added proguard rules as follow:

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

Hope it will helps you. Thank you.

like image 131
Pratik Butani Avatar answered Oct 17 '22 08:10

Pratik Butani


In my case, this bug happened when I tried to show a Google Map in my app. Specifically google-map-v3-beta SDK.

It looks like the SDK contains an obfuscated version of Glide that breaks when the app also uses Glide and the final AndroidManifest.xml contains a meta-data element called "GlideModule".

There is an issue for that in the google tracker: https://issuetracker.google.com/issues/132323222

Solution for me was to switch back to maps v2.

like image 21
Simon Avatar answered Oct 17 '22 09:10

Simon


I faced similar issue with my apps. I upgraded Glide library from 4.9.0 to 4.11.0.

Before:

implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation ('com.github.bumptech.glide:okhttp3-integration:4.9.0'){
    exclude group: 'glide-parent'
}

After:

implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation ('com.github.bumptech.glide:okhttp3-integration:4.11.0'){
    exclude group: 'glide-parent'
}

That fixed the problem.

like image 30
YazidEF Avatar answered Oct 17 '22 08:10

YazidEF


I had this bug too. Probably you are using a library that used another Glide version, so you should use the same as the version of the Glide library that your library used it.

like image 35
Muhammad Ali Avatar answered Oct 17 '22 08:10

Muhammad Ali