小编Max*_*axM的帖子

加载大型本机库时,Xamarin iOS会抛出System.TypeInitializationException

我有一个使用Xamarin iOS构建的iOS应用程序在加载具有PInvoke调用的DllImport属性的类时崩溃.例外是:

Unhandled managed exception: An exception was thrown by the type initializer for Pazanga.Native.ZzPINVOKE (System.TypeInitializationException)
Run Code Online (Sandbox Code Playgroud)

该应用程序运行良好,但当本机库的大小增加时开始崩溃.在裁剪了库的某些部分后,它再次工作,但在链接新库后,它又开始崩溃了.在实际对本机库进行任何调用之前发生崩溃.

这是崩溃后的设备日志:http://pastebin.com/vW3CMXHq

内部例外是:

Aug 23 10:33:40 Outboxs-iPod pazanga[4216] <Warning>: System.TypeInitializationException: An exception was thrown by the type initializer for Pazanga.Native.ZzPINVOKE ---> System.TypeInitializationException: An exception was thrown by the type initializer for SWIGStringHelper ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper native-to-managed) Pazanga.Native.ZzPINVOKE/SWIGStringHelper:CreateString (intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at (wrapper managed-to-native) object:__icall_wrapper_mono_delegate_to_ftnptr (object)
at (wrapper managed-to-native) Pazanga.Native.ZzPINVOKE/SWIGStringHelper:SWIGRegisterStringCallback_Zz …
Run Code Online (Sandbox Code Playgroud)

exception xamarin.ios

5
推荐指数
1
解决办法
1915
查看次数

标签 统计

exception ×1

xamarin.ios ×1