Mohd Naushad
Mohd Naushad

Reputation: 572

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.

Upvotes: 22

Views: 7714

Answers (6)

suwu150
suwu150

Reputation: 1231

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

Upvotes: 0

Mohamed Mohamed Taha
Mohamed Mohamed Taha

Reputation: 172

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'

Upvotes: 0

Pratik Butani
Pratik Butani

Reputation: 62429

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.

Upvotes: 20

Muhammad Ali
Muhammad Ali

Reputation: 740

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.

Upvotes: 1

Yazid
Yazid

Reputation: 439

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.

Upvotes: 7

Simon
Simon

Reputation: 2733

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.

Upvotes: 6

Related Questions