【发布时间】:2015-07-21 10:09:01
【问题描述】:
大家好,最近我注意到有时我的应用程序在调用/尝试启动我创建的类时崩溃,并出现以下错误:
Fatal Exception: java.lang.NoClassDefFoundError com.myapp.classes.ImageSdCardCache
我正在尝试在这样的活动中引用/调用 ImageSdCardCache:
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new WeakMemoryCache())
.diskCache(new ImageSdCardCache(new File(Environment.getExternalStorageDirectory().getPath() + "/MyAppCache/cache"))) //the problem line
.defaultDisplayImageOptions(options)
.memoryCacheExtraOptions(300,300)
.build();
我在这里尝试启动 ImageLoader,但有时(并非总是)它会失败,没有找到类异常。我做错了什么?
这是 ImageSdCardCache.java 放置在与我的活动所在文件夹不同的文件夹中。
public class ImageSdCardCache extends BaseDiskCache {
public ImageSdCardCache(File cacheDir) {
super(cacheDir);
}
}
【问题讨论】:
标签: java android class android-studio noclassdeffounderror