Glide: GlideApp not accecible

Created on 31 May 2017  路  4Comments  路  Source: bumptech/glide

I cannot access GlideApp thought i'm creating this class , is there anything missing?


Glide Version: 4.0.0 RC


Integration libraries: nothing

Glide load line / GlideModule (if any) / list Adapter code (if any):

package mobi.foo.project.activity;

import android.content.Context;

import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.module.AppGlideModule;

/**
 * Created by Jack Lebbos on 5/31/2017.
 */
@GlideModule
public final class MyGlideModule extends AppGlideModule {
    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        super.applyOptions(context, builder);
        setMemoryCache(context, builder);
    }

    public MyGlideModule() {
        super();
    }

    @Override
    public void registerComponents(Context context, Registry registry) {
        super.registerComponents(context, registry);
    }

    public void setMemoryCache(Context context, GlideBuilder builder) {
        int memoryCacheSizeBytes = 1024 * 1024 * 20; // 20mb
        builder.setMemoryCache(new LruResourceCache(memoryCacheSizeBytes));
    }

    public void setDiskCache() {
        int diskCacheSizeBytes = 1024 * 1024 * 100; // 100 MB

    }

}

All 4 comments

Duplicate of #1939, you're probably missing the annotationProcessor gradle dependency, see http://bumptech.github.io/glide/doc/download-setup.html#gradle

I am including it in my app but nothing happens.
This is my gradle file:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

//    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 25
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}

dependencies {
    compile project(":libs:framework")
//    compile 'mobi.foo:framework:1.1.+'
    compile 'com.github.bumptech.glide:glide:4.0.0-RC0'
    compile 'com.github.bumptech.glide:compiler:4.0.0-RC0'

    compile 'com.android.support:support-v4:25.3.1'
}

@jack9394 Please refer to this comment: https://github.com/bumptech/glide/issues/1982#issuecomment-305208633

Please add @GlideModule and clean and rebuild the project

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PatrickMA picture PatrickMA  路  3Comments

sant527 picture sant527  路  3Comments

kooeasy picture kooeasy  路  3Comments

ersen-osman picture ersen-osman  路  3Comments

StefMa picture StefMa  路  3Comments