嗨,大家好,我注意到,在調用有時我的應用程序崩潰時/試圖發起我用下面的錯誤創建的類:安卓:無法找到我的項目中類最近
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);
}
}
你讓我的朋友很好。但爲什麼是NoClassDefFoundError異常?它不應該是不同的東西嗎? – user5035668
你使用eclipse嗎? – yshahak
不,我使用Android工作室 – user5035668