I have an iPad application that I have been developing on simulator just fine (xcode 4, md 2.8, mt 5). However, when I try to deploy to the device the application crashes while launching. There are no crash logs in xcode and the console window is not displaying any errors.
However, when I run monotouch from the terminal I get the following output:
Rich-MacBook-Pro:~ rich3$ /Developer/MonoTouch/usr/bin/mtouch –debugsim=$/private/var/mobile/Applications/31A80564-0CEF-4F4B-AE9D-6A1938510393
Invalid SDK specified: 3.2
Stacktrace:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_intptr_intptr_bool (intptr,intptr,intptr,intptr,bool) <0xffffffff>
at MonoTouch.Foundation.NSObject.Dispose (bool) <0x0009f>
at MonoTouch.Foundation.NSObject.Finalize () <0x00016>
at (wrapper runtime-invoke) object.runtime_invoke_virtual_void_this_ (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
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
Debug info from 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
UPDATE:
I finally nailed down my issue to two things.
-
Generics and value-types don’t play
well together when AOT is used (and that’s required to execute on iOS
devices). So I needed to change a query:
From: ‘CSDatabase.RunQuery(“select max(VersionNbr) from schema_version”).FirstOrDefault();’
To: CSDatabase.RunQuery(“select max(VersionNbr) from schema_version”).First(); -
Next I need to add the argument for the trampolines (-aot “nimt-trampolines=2048”) and only linked monotouch sdk during build. That cleared up the rest of my issues.
There are two issues here.
The second one looks caused by:
Invalid SDK specified: 3.2
Simply you do not have the 3.2 SDK installed (it’s not shipped by default with iOS5 SDK). Try the following command:
and it should work fine.
As for the first issue there’s not much detail to help you. If no crash dump is produced (it happens, e.g. when not enough memory is available) then try the following:
a) open a terminal window on your computer;
b) execute the following command
c) start application on device;
d) make it crash (seems automatic in this case 😉
e) copy/paste the device log into your question (if small) or fill a bug report at http://bugzilla.xamarin.com (if large)