2012-01-11 127 views
0

我知道有一個很多與這個相同的標題SO問題,但他們都顯得非常不同。不過,標題描述了主要症狀。MonoTouch應用程序運行在模擬器,但不是在設備上

我有一個MonoTouch應用程序,它在模擬器中工作得非常棒。即使設備配置和應用簽名過程也非常順利。

但是,當應用程序在設備上運行時,它立即崩潰。 我能看到它在Application.cs崩潰(在該行UIApplication.Main(...)):

using System; 
    using MonoTouch.UIKit; 

    namespace MyApp 
    { 
    public class Application 
    { 
     public static void Main (string[] args) 
     { 
     try 
     { 
      UIApplication.Main (args, null, "AppDelegate"); //CRASHES HERE! 
     } 
     catch (Exception e) 
      { 
      Console.WriteLine (e.ToString()); 
      } 
     } 
     } 
    } 

與閉鎖outout指出一些通用的:System.NullReferenceException: Object reference not set to an instance of an object

崩潰報告如下:

Application Specific Information: 
com.testing.game failed to launch in time 

Elapsed total CPU time (seconds): 3.140 (user 3.140, system 0.000), 16% CPU 
Elapsed application CPU time (seconds): 1.616, 8% CPU 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0: 
0 libsystem_kernel.dylib   0x321de068 __psynch_cvwait + 24 
1 libsystem_c.dylib    0x36696f2e _pthread_cond_wait + 634 
2 libsystem_c.dylib    0x36696caa pthread_cond_wait + 34 
3 GameB       0x007b8954 suspend_current (debugger-agent.c:2375) 
4 GameB       0x007bad30 process_event (debugger-agent.c:3013) 
5 GameB       0x007bd69c process_breakpoint_inner (debugger-agent.c:3837) 
6 GameB       0x007bd7f4 process_breakpoint (debugger-agent.c:3855) 
7 ???        0x014fdff8 0 + 22011896 
8 GameB       0x004e3858 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr (mscorlib.dll.6.s:148399) 
9 GameB       0x0077d7dc mono_jit_runtime_invoke (mini.c:5784) 
10 GameB       0x00890eb0 mono_runtime_invoke (object.c:2757) 
11 GameB       0x008940d0 mono_runtime_exec_main (object.c:3940) 
12 GameB       0x0089309c mono_runtime_run_main (object.c:3562) 
13 GameB       0x00788748 mono_jit_exec (driver.c:1102) 
14 GameB       0x0077371c main (main.m:2505) 
15 GameB       0x0006c978 start + 44 

Thread 1 name: Dispatch queue: com.apple.libdispatch-manager 
Thread 1: 
0 libsystem_kernel.dylib   0x321ce3b4 kevent + 24 
1 libdispatch.dylib    0x32922e78 _dispatch_mgr_invoke + 708 
2 libdispatch.dylib    0x32922b96 _dispatch_mgr_thread + 30 

Thread 2: 
0 libsystem_kernel.dylib   0x321de470 __recvfrom + 20 
1 libsystem_c.dylib    0x36693aa0 recv + 16 
2 GameB       0x007b55c4 recv_length (debugger-agent.c:996) 
3 GameB       0x007c8bfc debugger_thread (debugger-agent.c:7136) 
4 GameB       0x009030d4 thread_start_routine (wthreads.c:287) 
5 GameB       0x00943dc8 GC_start_routine (pthread_support.c:1468) 
6 libsystem_c.dylib    0x36696c16 _pthread_start + 314 
7 libsystem_c.dylib    0x36696ad0 thread_start + 0 

Thread 3: 
0 libsystem_kernel.dylib   0x321ce060 semaphore_wait_trap + 8 
1 GameB       0x009152e8 mono_sem_wait (mono-semaphore.c:115) 
2 GameB       0x0081d648 finalizer_thread (gc.c:1070) 
3 GameB       0x008cec40 start_wrapper_internal (threads.c:783) 
4 GameB       0x008ced48 start_wrapper (threads.c:831) 
5 GameB       0x009030d4 thread_start_routine (wthreads.c:287) 
6 GameB       0x00943dc8 GC_start_routine (pthread_support.c:1468) 
7 libsystem_c.dylib    0x36696c16 _pthread_start + 314 
8 libsystem_c.dylib    0x36696ad0 thread_start + 0 

Thread 4 name: WebThread 
Thread 4: 
0 libsystem_kernel.dylib   0x321ce010 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x321ce206 mach_msg + 50 
2 CoreFoundation     0x30ecd41c __CFRunLoopServiceMachPort + 120 
3 CoreFoundation     0x30ecc154 __CFRunLoopRun + 876 
4 CoreFoundation     0x30e4f4d6 CFRunLoopRunSpecific + 294 
5 CoreFoundation     0x30e4f39e CFRunLoopRunInMode + 98 
6 WebCore       0x376e3128 _ZL12RunWebThreadPv + 396 
7 libsystem_c.dylib    0x36696c16 _pthread_start + 314 
8 libsystem_c.dylib    0x36696ad0 thread_start + 0 

Unknown thread crashed with unknown flavor: 5, state_count: 1 

任何人都可以看到爲什麼這可能會崩潰嗎? 我在一個總損失...

乾杯, 佈雷特

+0

請註明您正在使用的MonoTouch和MonoDevelop的版本。另外,如果您使用外部庫,請確保** iPhoneSimulator | Debug **和** iPhone | Debug **之間的'額外mtouch參數'相同 – poupou 2012-01-11 23:06:40

+0

打開xcode並再次從xcode檢查設備控制檯,有時您可能會看到更多有用...在應用程序崩潰後... – dalexsoto 2012-01-11 23:44:54

回答

2

崩潰報告看起來無關您的問題。

com.testing.game未能及時

推出上述表示的iOS看門狗打死的應用,因爲它佔用了太多的時間來啓動(15秒左右)。

6 GameB 0x007bd7f4 process_breakpoint(調試器agent.c:3855)

堆棧跟蹤建議你等待一個斷點。如果發生這種情況,之前FinishedLaunching返回,那麼這可能是看門狗殺死你的應用程序(以及崩潰報告包含什麼)的原因。

再次確保您的額外的mTouch參數iPhoneSimulator之間相同|調試iPhone |調試。如果這仍然崩潰然後運行

/Developer/MonoTouch/usr/bin/mtouch --logdev 

從終端窗口並重新崩潰您的應用程序。複製/粘貼輸出到你的問題。請注意,您應該嘗試使用調試版本,因爲我懷疑後者更詳細。

相關問題