c# – Xamarin Android崩溃开始“有一个SIGSEGV”

我有一个Xamarin Forms应用程序,所以我要发布我的应用程序,但我发现了一个错误,只能在旧的(2.3.7和4.0.4)xperia设备或模拟器上遇到,所以我的应用程序崩溃如同我在菜单中单击了一个应用程序图标,这是我在输出中看到的内容:

06-10 12:46:18.344 E/mono-rt ( 2885): Stacktrace:
06-10 12:46:18.344 E/mono-rt ( 2885): 
06-10 12:46:18.344 E/mono-rt ( 2885):   at <unknown> <0xffffffff>
06-10 12:46:18.344 E/mono-rt ( 2885):   at (wrapper managed-to-native) object.wrapper_native_0x8235c890 (intptr,intptr,string,string) <IL 0x00054, 0xffffffff>
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.GetMethodID (intptr,string,string) [0x00042] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:158
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.CreateInstance (intptr,string,Android.Runtime.JValue*) [0x00000] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:377
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.CreateInstance (System.Type,string,Android.Runtime.JValue*) [0x00007] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:411
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.StartCreateInstance (System.Type,string,Android.Runtime.JValue*) [0x00011] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:320
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.StartCreateInstance (System.Type,string,Android.Runtime.JValue[]) [0x0001d] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:326
06-10 12:46:18.344 E/mono-rt ( 2885):   at Java.Lang.Object..ctor () [0x0001c] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:72
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.UncaughtExceptionHandler..ctor (Java.Lang.Thread/IUncaughtExceptionHandler) [0x00000] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/UncaughtExceptionHandler.cs:28
06-10 12:46:18.344 E/mono-rt ( 2885):   at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs*) [0x002f4] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:245
06-10 12:46:18.344 E/mono-rt ( 2885):   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_intptr (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>
06-10 12:46:18.344 E/mono-rt ( 2885): 
06-10 12:46:18.344 E/mono-rt ( 2885): Attempting native Android stacktrace:
06-10 12:46:18.344 E/mono-rt ( 2885): 
06-10 12:46:18.344 E/mono-rt ( 2885):   Could not unwind with `libunwind.so`: Cannot load library: load_library[1109]: Library '/data/data/com.telohranitel24/lib/libunwind.so' not found
06-10 12:46:18.344 E/mono-rt ( 2885):   Could not unwind with `libcorkscrew.so`: Cannot load library: load_library[1109]: Library '/data/data/com.telohranitel24/lib/libcorkscrew.so' not found
06-10 12:46:18.344 E/mono-rt ( 2885): 
06-10 12:46:18.344 E/mono-rt ( 2885):   No options left to get a native stacktrace :-(
06-10 12:46:18.344 E/mono-rt ( 2885): 
06-10 12:46:18.344 E/mono-rt ( 2885): =================================================================
06-10 12:46:18.344 E/mono-rt ( 2885): Got a SIGSEGV while executing native code. This usually indicates
06-10 12:46:18.344 E/mono-rt ( 2885): a fatal error in the mono runtime or one of the native libraries 
06-10 12:46:18.344 E/mono-rt ( 2885): used by your application.
06-10 12:46:18.344 E/mono-rt ( 2885): =================================================================
06-10 12:46:18.344 E/mono-rt ( 2885): 

我不知道为什么会这样,任何想法都会有所帮助,拜托!

最佳答案 虽然Xamarin支持Android的所有API级别,但Xamarin.Forms仅支持API级别15,您应将Minimum SDK设置为15.以下是我们的文档:

http://developer.xamarin.com/guides/cross-platform/xamarin-forms/introduction-to-xamarin-forms/#Requirements

这意味着Xamarin.Forms支持94%的Android设备:https://developer.android.com/about/dashboards/index.html?utm_source=suzunone

点赞