API级别11上的java.lang.NoClassDefFoundError

Jac*_*ack 0 android noclassdeffounderror

我在使用API​​级别11时遇到错误.

我的应用程序崩溃了以下内容: java.lang.NoClassDefFoundError: com.question.question.BitmapCache只有当我将我的应用程序与运行api级别11的设备一起使用时:

我有谷歌这个当然,并尝试了我遇到的每一个解决方案,但仍然没有运气.

以下是Logcat中存在问题的行:

    public GoogleCardsAdapter(final Context context) {
    mContext = context;
    mMemoryCache = new BitmapCache();  //<---- This line here
}
Run Code Online (Sandbox Code Playgroud)

这是位图缓存类:

public class BitmapCache extends LruCache<Integer, Bitmap> {

private static final int KILO = 1024;
private static final int MEMORY_FACTOR = 2 * KILO;

public BitmapCache() {
    super((int) (Runtime.getRuntime().maxMemory() / MEMORY_FACTOR));
}

@Override
protected int sizeOf(final Integer key, final Bitmap value) {
    return value.getRowBytes() * value.getHeight() / KILO;
}
     }
Run Code Online (Sandbox Code Playgroud)

我也在使用一些库:

在此输入图像描述

在此输入图像描述

如果有人知道这里出了什么问题,那将非常感激.

Com*_*are 5

据推测,您正在尝试使用android.util.LruCache,仅存在于API级别12及更高版本中.

考虑切换到android.support.v4.util.LruCacheAndroid支持包,它将返回到API级别4.

另外,请撤消对构建路径的手动修改,并将Picasso和ListViewAnimations JAR复制到项目的libs/目录中,这样JAR就在您的构建路径上打包到APK中进行分发.