20

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.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Mohd Naushad
  • 514
  • 4
  • 15

6 Answers6

18

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.

Fattie
  • 27,874
  • 70
  • 431
  • 719
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
6

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.

Simon
  • 2,643
  • 3
  • 40
  • 61
5

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.

Yazid
  • 409
  • 7
  • 8
1

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.

Muhammad Ali
  • 720
  • 8
  • 21
0

Just you need to put the version compiler the same version in glide implementation 'com.github.bumptech.glide:glide:4.11.0' kapt 'com.github.bumptech.glide:compiler:4.11.0'

0

Add this to android/build.gradle.

  buildscript {
   ext {
    excludeAppGlideModule = true
   }

link:

https://github.com/DylanVann/react-native-fast-image/issues/670 https://github.com/DylanVann/react-native-fast-image/issues/318

suwu150
  • 1,209
  • 2
  • 8
  • 10