8

In the new version of the Glide 4.3 I'm trying to use it but it crash whenever I use it and whatever context I passed to it.

this is the error showed to me

   java.lang.AbstractMethodError: abstract method "void com.bumptech.glide.module.RegistersComponents.registerComponents(android.content.Context, com.bumptech.glide.Glide, com.bumptech.glide.Registry)"

this is my code I tried:

Glide.with(getApplicationContext()).
            load(url)
            .into(imageView);

and

   Glide.with(getContext()).
            load(url)
            .into(imageView);

and it give me that warning

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

and the code in lib in gradle

compile 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'

Update1 : Waring Solved By Adding a class that extends AppGlideModule

import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;

@GlideModule
public final class MyAppGlideModule extends AppGlideModule {}

but the same error still exist

Sattar
  • 2,453
  • 2
  • 33
  • 47
  • 1
    if the `annotationProcessor ` is added inside any library's build.gradle file, try adding it to the app's build.gradle file or else check this https://github.com/bumptech/glide/issues/2243 – Navneet Krishna Nov 16 '17 at 11:37
  • have you added in here, project repositories { mavenCentral() maven { url 'https://maven.google.com' } } – hemen Nov 16 '17 at 11:56

2 Answers2

7

Please Add The Following Method on Your AppGlideModule class

@Override
public boolean isManifestParsingEnabled() {
  return false;
}

To maintain backward compatibility with Glide v3’s GlideModules, Glide still parses AndroidManifest.xml files from both the application and any included libraries and will include any legacy GlideModules listed in the manifest. Although this functionality will be removed in a future version, we’ve retained the behavior for now to ease the transition. If you’ve already migrated to the Glide v4 AppGlideModule and LibraryGlideModule, you can disable manifest parsing entirely. Doing so can improve the initial startup time of Glide and avoid some potential problems with trying to parse metadata. To disable manifest parsing, override the isManifestParsingEnabled() method in your AppGlideModule implementation

Check : http://bumptech.github.io/glide/doc/configuration.html

Mohammed Gamal
  • 234
  • 1
  • 8
1

for people who came here like me and spent two days to figure out where is AppGlideModule or so, I write it for those people you must create a Class in your Application and Name it "MyAppGlideModule" then you should put this code in that class

package com.arash;


import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;

@GlideModule
    public final class MyAppGlideModule extends AppGlideModule {
        @Override
        public boolean isManifestParsingEnabled() {
            return false;
        }
    }

that's it.

Arash Afsharpour
  • 1,282
  • 11
  • 22
  • 1
    Just one comment: it does not have to be MyAppGlideModule it can be any name: it's the annotation that counts and the actual definition – kingston May 06 '18 at 15:26