我在CommonsWare博客上看到,在推出Android 6.0之前将appcompat-v7更新到最新版本是一个明智的想法所以我只是继续尝试用我在Eclipse中的项目来做到这一点。更新库后(我只是删除了以前的版本并添加了新版本的资源),我的(以前的ActionBarActivity)AppCompatActivity没有启动(应用程序崩溃)。这是LogCat内容:
08-20 02:55:58.417: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV7>
08-20 02:55:58.418: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV7>
08-20 02:55:58.419: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV11>
08-20 02:55:58.419: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV11>
08-20 02:55:58.419: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV14>
08-20 02:55:58.420: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV14>
08-20 02:55:58.420: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV23>
08-20 02:55:58.420: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV23>
08-20 02:55:58.421: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV14>
08-20 02:55:58.421: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV11>
08-20 02:55:58.421: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV7>
08-20 02:55:58.421: I/art(28031): Rejecting re-init on previously-failed class java.lang.Class<android.support.v7.app.AppCompatDelegateImplV23>
08-20 02:55:58.421: D/AndroidRuntime(28031): Shutting down VM
08-20 02:55:58.422: E/AndroidRuntime(28031): FATAL EXCEPTION: main
08-20 02:55:58.422: E/AndroidRuntime(28031): Process: com.threeeplusplus.karkoona, PID: 28031
08-20 02:55:58.422: E/AndroidRuntime(28031): java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV23
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:133)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:117)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:456)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
08-20 02:55:58.422: E/AndroidRuntime(28031): at com.threeeplusplus.karkoona.activities.CentralNavActivity.onCreate(CentralNavActivity.java:154)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.Activity.performCreate(Activity.java:6237)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.ActivityThread.-wrap11(ActivityThread.java)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.os.Handler.dispatchMessage(Handler.java:102)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.os.Looper.loop(Looper.java:148)
08-20 02:55:58.422: E/AndroidRuntime(28031): at android.app.ActivityThread.main(ActivityThread.java:5417)
08-20 02:55:58.422: E/AndroidRuntime(28031): at java.lang.reflect.Method.invoke(Native Method)
08-20 02:55:58.422: E/AndroidRuntime(28031): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
08-20 02:55:58.422: E/AndroidRuntime(28031): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
我一直试图解决这个问题几个小时但没有任何作用!我清理,重新清理,删除了库,重新添加,检查.jar文件中包含的类文件,确定那里有AppCompatDelegateImplV23等等。没有。
有什么想法吗?
答案 0 :(得分:0)
在尝试了我能想到的一切之后,我最终从我的项目&#s; / bin文件夹中删除了工作区中的库,android-support-v4.jar和android-support-v7-appcompat.jar。我也去了Properties - &gt; Android和Libraries部分删除了android-support-v7-appcompat。
我还删除了与Java Build Path中的支持库相关的所有内容 - &gt;库和Java构建路径 - &gt;订单和出口。
然后我重新导入了库,错误就消失了。该应用程序现在可以工作,但v23 appcompat库有点混乱(例如,操作模式不会覆盖支持工具栏,它现在显示在它上面 - 即在状态栏和工具栏之间)
答案 1 :(得分:0)
我遇到了完全相同的错误并且遇到了以下解决方案:
使用您的开发项目关闭您的实际工作区
创建新工作区
固定