我在CommonsWare博客上看到,在Android 6.0的推出之前更新appcompat-v7到最新版本是一個聰明的主意,所以我只是繼續嘗試在Eclipse中使用我的項目來做到這一點。更新庫後(我只是刪除了以前的版本,並添加了新的資源),我的(以前的ActionBarActivity)AppCompatActivity沒有啓動(應用程序崩潰)。這是LogCat內容:已更新appcompat-v7到最新版本,獲取NoClassDefFound的AppCompatDelegateImplV23
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等。
任何想法?
你使用的是eclipse還是as?你用哪個api來編譯? –
我正在使用Eclipse。 minSdk是16,targetSdk是23. – Antonis427
targetSdk和compileSdk是不同的。 –