【发布时间】:2011-12-12 00:58:03
【问题描述】:
我有一个我一直在模拟器上开发的 iPad 应用程序(xcode 4、md 2.8、mt 5)。但是,当我尝试部署到设备时,应用程序在启动时崩溃。 xcode 中没有崩溃日志,控制台窗口也没有显示任何错误。
但是,当我从终端运行 monotouch 时,我得到以下输出:
Rich-MacBook-Pro:~rich3$ /Developer/MonoTouch/usr/bin/mtouch --debugsim=$/private/var/mobile/Applications/31A80564-0CEF-4F4B-AE9D-6A1938510393 指定的 SDK 无效:3.2 堆栈跟踪:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_intptr_intptr_bool (intptr,intptr,intptr,intptr,bool) 在 MonoTouch.Foundation.NSObject.Dispose (bool) 在 MonoTouch.Foundation.NSObject.Finalize () at (wrapper runtime-invoke) object.runtime_invoke_virtual_void_this_ (object,intptr,intptr,intptr)
本机堆栈跟踪:
0 mtouch 0x000ec183 WriteZStream + 955779
1 mtouch 0x0001bd4f WriteZStream + 102735
2 libsystem_c.dylib 0x9020459b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 Foundation 0x9a0603de -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 160
5 ??? 0x027d5884 0x0 + 41769092
6 ??? 0x027d0e40 0x0 + 41750080
7 ??? 0x027d559f 0x0 + 41768351
8 ??? 0x025e5551 0x0 + 39736657
9 mtouch 0x001a76c4 WriteZStream + 1723076
10 mtouch 0x001a968a WriteZStream + 1731210
11 mtouch 0x001a98c4 WriteZStream + 1731780
12 mtouch 0x002735c1 WriteZStream + 2558401
13 mtouch 0x00273677 WriteZStream + 2558583
14 mtouch 0x002b8b0e WriteZStream + 2842382
15 mtouch 0x002f31d8 WriteZStream + 3081688
16 libsystem_c.dylib 0x901aced9 _pthread_start + 335
17 libsystem_c.dylib 0x901b06de thread_start + 34
来自 gdb 的调试信息:
/tmp/mono-gdb-commands.1eukTW:1: Error in sourced command file:
unable to debug self
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Abort trap: 6
更新: 我终于把我的问题归结为两件事。
泛型和值类型不起作用 使用 AOT 时很好地结合在一起(这是在 iOS 上执行所必需的 设备)。所以我需要更改一个查询: 来自:'CSDatabase.RunQuery("select max(VersionNbr) from schema_version").FirstOrDefault();' To: CSDatabase.RunQuery("select max(VersionNbr) from schema_version").First();
接下来我需要为蹦床添加参数 (-aot "nimt-trampolines=2048") 并且仅在构建期间链接 monotouch sdk。这解决了我的其他问题。
【问题讨论】:
标签: ios xcode ipad xamarin.ios ios-simulator