Sof*_*ion 6 mono xamarin.android visual-studio-app-center
我的xamarin安卓应用程序运行正常,每次启动都会因此异常而崩溃.
该应用程序是从appcenter的构建服务构建的,一如既往.如果我在Debug或Release模式下在本地构建它,它会正常启动.使用Android 7设备.
有没有人遇到这个例外,知道该怎么办?
Ty!
18828 W monodroid: Calling into managed runtime init
E mono :
E mono : Unhandled Exception:
E mono : System.TypeInitializationException: The type initializer for 'Android.Runtime.UncaughtExceptionHandler' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
E mono : Parameter name: method
E mono : at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) <0x56d026b4 + 0x00d74> in :0
E mono : at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) <0x56d03594 + 0x0001f> in :0
: at Android.Runtime.UncaughtExceptionHandler..cctor () <0x57d908a4 + 0x0003f> in :0
: --- End of inner exception stack trace ---
: at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
: at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args)
- 编辑
启用所有AOT/LVVM /并发垃圾收集器/ proguard/multidex选项
- 编辑2
错误源代码:https://github.com/xamarin/xamarin-android/blob/master/src/Mono.Android/Android.Runtime/UncaughtExceptionHandler.cs
static UncaughtExceptionHandler ()
{
var mono_UnhandledException = typeof (System.Diagnostics.Debugger)
.GetMethod ("Mono_UnhandledException", BindingFlags.NonPublic | BindingFlags.Static);
mono_unhandled_exception = (Action<Exception>) Delegate.CreateDelegate (typeof(Action<Exception>), mono_UnhandledException);
var ad_due = typeof (AppDomain)
.GetMethod ("DoUnhandledException",
bindingAttr: BindingFlags.NonPublic | BindingFlags.Instance,
binder: null,
types: new []{typeof (UnhandledExceptionEventArgs)},
modifiers: null);
if (ad_due != null) {
AppDomain_DoUnhandledException = (Action<AppDomain, UnhandledExceptionEventArgs>) Delegate.CreateDelegate (
typeof (Action<AppDomain, UnhandledExceptionEventArgs>), ad_due);
}
}
Run Code Online (Sandbox Code Playgroud)
所以似乎mono_UnhandledException为null或AppDomain_DoUnhandledException为null.
将尝试在appcenter中升级或降级单声道版本.应该是错的.
- 编辑3
AppDomain.cs最近改为单声道:
但是DoUnhandledException没有改变.
- 编辑4
在本地构建/发布时工作正常.所以问题是appcenter特有的.
归档时间: |
|
查看次数: |
786 次 |
最近记录: |