Xamarin Android中的java.lang.NoClassDefFoundError:android.support.v7.app.AppCompatDelegateImplV14

时间:2015-06-25 20:40:46

标签: android xamarin android-support-library

自支持库更新以来突然开始收到此错误,即使所有内容都正常运行,它也会在启动时崩溃应用程序。我试图使用较低版本的软件包,这给了我同样的错误。我尝试完全重新安装Xamarin和Android SDK,最后创建了一个使用AppCompat但没有成功的新项目。

Android支持资源库v22.2

包裹:

  • Xamarin.Android.Support.v7.AppCompat v22.2
  • Xamarin.Android.Support.v7.MediaRouter v22.2
  • Xamarin.Android.Support.v4 v22.2
  • Xamarin.Android.Support.v13 v22.2
  • Xamarin.GooglePlayServices v22.2.0.2

调用堆栈:

System.Diagnostics.Debugger.Mono_UnhandledException_internal () in 
System.Diagnostics.Debugger.Mono_UnhandledException (ex={Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00078>
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue*) [0x00084] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1029
at Android.App.Activity.OnCreate (Android.OS.Bundle) [0x00070] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2725
at MyApp.MainActivity.OnCreate (Android.OS.Bundle) [0x0001f] in c:\Users\Admin\Documents\Projects\MyApp\MyApp\Activities\MainActivity.cs:43
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:2707
at (wrapper dynamic-method) object.e364abe5-1498-42eb-85b3-b3d7986e8b04 (intptr,intptr,intptr) <IL 0x00017, 0x00043>

  --- End of managed exception stack trace ---
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
    at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
    at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
    at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
    at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
    at md5528fae1ec675c410de183ce65ec994d2.MainActivity.n_onCreate(Native Method)
    at md5528fae1ec675c410de183ce65ec994d2.MainActivity.onCreate(MainActivity.java:37)
    at android.app.Activity.performCreate(Activity.java:5933)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
    at android.app.ActivityThread.access$800(ActivityThread.java:149)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:211)
    at android.app.ActivityThread.main(ActivityThread.java:5333)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
}) in 
Android.Runtime.UncaughtExceptionHandler.UncaughtException (thread=, ex=) in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/UncaughtExceptionHandler.cs:35
Java.Lang.Thread.IUncaughtExceptionHandlerInvoker.n_UncaughtException_Ljava_lang_Thread_Ljava_lang_Throwable_ (Parameters=) in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Java.Lang.Thread.cs:221
object.ce1e54b9-203c-4387-b0fe-be79adb149c0 (Parameters=) in 

1 个答案:

答案 0 :(得分:0)

今天我重新安装了所有支持库,再次清理并重新编译了应用程序,错误消失了。