ClassNotFoundException:找不到类"android.os.PersistableBundle";奥托Android 5.0 [英] ClassNotFoundException: Didn't find class "android.os.PersistableBundle" Otto Android 5.0

查看:160
本文介绍了ClassNotFoundException:找不到类"android.os.PersistableBundle";奥托Android 5.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题. 我有一个部署在Android 4.4设备上并使用Otto库的应用程序. 我在Android 5.0设备上部署了该应用程序.它仍然有效. 我重试了4.4,但该应用程序无法启动.

I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched.

显然,它尝试使用API​​ 21类的PersistableBundle.class. 这是我的日志:

Apparently, it tries to use PersistableBundle.class which a API 21 class. Here my log :

    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.os.PersistableBundle" on path: DexPathList[[zip file "/data/app/fr.myapp.apk"],nativeLibraryDirectories=[/data/app-lib/fr.myapp, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
            at java.lang.Class.getDeclaredMethods(Native Method)
            at java.lang.Class.getDeclaredMethods(Class.java:656)
            at com.squareup.otto.AnnotatedHandlerFinder.loadAnnotatedMethods(AnnotatedHandlerFinder.java:52)
            at com.squareup.otto.AnnotatedHandlerFinder.findAllProducers(AnnotatedHandlerFinder.java:126)
            at com.squareup.otto.HandlerFinder$1.findAllProducers(HandlerFinder.java:33)
            at com.squareup.otto.Bus.register(Bus.java:191)

推荐答案

我找到了解决方案". 只需从您的活动中删除此功能:

I find the "solution". Just remove this function from your activity :

@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
    super.onSaveInstanceState(outState, outPersistentState);
}

这篇关于ClassNotFoundException:找不到类"android.os.PersistableBundle";奥托Android 5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆