nawaab saab
nawaab saab

Reputation: 1902

Glide 4.4 java.lang.AbstractMethodError

I was getting timeout exception in glide, So I tried to increase time. After doing that it gave AbstractMethodError.

class com.bumptech.glide.load.engine.GlideException: Failed to load resource
                                                               Cause (1 of 1): class java.lang.AbstractMethodError: abstract method "com.bumptech.glide.load.model.ModelLoader com.bumptech.glide.load.model.ModelLoaderFactory.build(com.bumptech.glide.load.model.MultiModelLoaderFactory)"

Code I have used, I have mentioned that below

dependencies {
compile 'com.github.bumptech.glide:glide:4.4.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
    compile 'com.github.bumptech.glide:okhttp3-integration:1.5.0@aar'
} 

@GlideModule
public final class MyAppGlideModule extends AppGlideModule {
    @Override
    public void registerComponents(Context context, Glide glide, Registry registry) {
        super.registerComponents(context, glide, registry);
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        builder.readTimeout(30, TimeUnit.SECONDS);
        builder.writeTimeout(30, TimeUnit.SECONDS);
        builder.connectTimeout(30, TimeUnit.SECONDS);
        registry.append(GlideUrl.class, InputStream.class,
                new OkHttpUrlLoader.Factory(builder.build()));
    }
    @Override
    public boolean isManifestParsingEnabled() {
        return false;
    }
}

Upvotes: 2

Views: 1040

Answers (1)

Rajesh N
Rajesh N

Reputation: 6693

Add or change okhttp3-integration:4.4.0 version

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

Upvotes: 2

Related Questions