1

I was using Glide to display image from firebase storage but I am getting this error:

W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored

I have tried to find the solutions from Glide Failed to find GeneratedAppGlideModule and Android Glide "Cannot Resolve Method 'with' in GlideApp" but both of them did not work.

Below are my sample code in recycler view adapter:

Glide.with(context).load(imageurl).into(viewHolder.getImageview());

and I am using the latest version of Glide:

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

Clean, rebuild project and invalidate/restart did not work for me. I appreciate if anyone could suggest solution to solve this issue. Thank you.

My codes in build.gradle (project):

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

My codes in build.gradle (module):

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

My codes in proguard-rules.pro:

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
  <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
   **[] $VALUES;
   public *;
}
-keep class
 com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
   *** rewind();
 }
Kangaroo
  • 11
  • 2

1 Answers1

0

According to the official documentation, you must:

  1. paste in your Gradle file

    repositories { google() mavenCentral() }

    dependencies { implementation 'com.github.bumptech.glide:glide:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' }

  2. Proguard - Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard.cfg

     -keep public class * implements com.bumptech.glide.module.GlideModule
     -keep class * extends com.bumptech.glide.module.AppGlideModule {
      <init>(...);
     }
     -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
       **[] $VALUES;
       public *;
     }
     -keep class 
     com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
       *** rewind();
      }
    
     # for DexGuard only
     -keepresourcexmlelements manifest/application/meta-data@value=GlideModule
    
DoctorWho
  • 1,044
  • 11
  • 34
  • Hi, thank you for your solution but it did not fix my problem. The error still exists after I adding these codes. I have added my codes (build.gradle and proguard-rules.pro) in my post above. Thank you. – Kangaroo Aug 17 '21 at 12:28