使用AVFoundation.AVPlayer时,我的应用程序中有时会发生崩溃。这是随机发生的,例如。 G。当用户改变视频的位置或播放/暂停视频时。我不知道如何解决它,因为崩溃似乎发生在MonoTouch层。
您可以在下面看到崩溃日志。
首先,是什么意思:System.ArgumentException: GCHandle value belongs to a different domain
?我尝试过谷歌,但我没有找到任何帮助。
此外,行MonoTouch_AVFoundation_AVPlayer_TrampolineAVCompletionHandler
可能表示我在构建设置中设置的蹦床数量存在问题:
-aot“ntrampolines = 4048”“nimt-trampolines = 4048”
也许我应该增加这个数字,但有人知道我们可以设定的限制是多少?如果我增加这个数字会有什么后果?性能/内存问题?
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: GCHandle value belongs to a different domain
at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00036] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs:126
at System.Runtime.InteropServices.GCHandle.FromIntPtr (IntPtr value) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs:169
at MonoTouch.AVFoundation.AVPlayer.TrampolineAVCompletionHandler (IntPtr block) [0x00007] in /Developer/MonoTouch/Source/monotouch/src/AVFoundation/AVPlayer.g.cs:501
at (wrapper native-to-managed) MonoTouch.AVFoundation.AVPlayer:TrampolineAVCompletionHandler (intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at Dartfish.Application.EasyCapture.Common.Application.Main (System.String[] args) [0x00000] in /Users/admin/Dev/Dartfish/Dartfish EasyCapture/Source/Application/EasyCaptureMonoTouch/Main.cs:17
Symbol file /private/var/mobile/Applications/A0243AD3-C734-41E1-981E-A1ACB2E1AB77/EasyCaptureMonoTouch.app/Dartfish.LibraryCoreHeimdall.dll.mdb doesn't match image /private/var/mobile/Applications/A0243AD3-C734-41E1-981E-A1ACB2E1AB77/EasyCaptureMonoTouch.app/Dartfish.LibraryCoreHeimdall.dll
Terminating runtime due to unhandled exception
Stacktrace:
Native stacktrace:
0 MonoTouchEasyCapture 0x0187e451 mono_handle_native_sigsegv + 244
1 MonoTouchEasyCapture 0x01895501 sigabrt_signal_handler + 112
2 libsystem_c.dylib 0x328ba7ed _sigtramp + 48
3 libsystem_c.dylib 0x328b020f pthread_kill + 54
4 libsystem_c.dylib 0x328a929f abort + 94
5 MonoTouchEasyCapture 0x0192cb5d monoeg_assertion_message + 0
6 MonoTouchEasyCapture 0x0192cb7f monoeg_assertion_message + 34
7 MonoTouchEasyCapture 0x0186ef95 mono_thread_abort + 112
8 MonoTouchEasyCapture 0x0187e1cf mono_handle_exception_internal + 2138
9 MonoTouchEasyCapture 0x0187e29d mono_handle_exception + 12
10 MonoTouchEasyCapture 0x018947c5 mono_arm_throw_exception + 116
11 MonoTouchEasyCapture 0x01072cc4 throw_exception + 48
12 MonoTouchEasyCapture 0x00f87cc8 System_Runtime_InteropServices_GCHandle_FromIntPtr_intptr + 36
13 MonoTouchEasyCapture 0x00513c30 MonoTouch_AVFoundation_AVPlayer_TrampolineAVCompletionHandler_intptr + 96
14 MonoTouchEasyCapture 0x0056e360 wrapper_native_to_managed_MonoTouch_AVFoundation_AVPlayer_TrampolineAVCompletionHandler_intptr + 64
15 AVFoundation 0x35303a51 __avplayeritem_fpItemNotificationCallback_block_invoke_0 + 3936
16 libdispatch.dylib 0x3433bc59 _dispatch_call_block_and_release + 12
17 libdispatch.dylib 0x3433dee7 _dispatch_main_queue_callback_4CF$VARIANT$mp + 194
18 CoreFoundation 0x354812ad __CFRunLoopRun + 1268
19 CoreFoundation 0x354044a5 CFRunLoopRunSpecific + 300
20 CoreFoundation 0x3540436d CFRunLoopRunInMode + 104
21 GraphicsServices 0x370a0439 GSEventRunModal + 136
22 UIKit 0x32f10cd5 UIApplicationMain + 1080
23 MonoTouchEasyCapture 0x0056dcec wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
24 MonoTouchEasyCapture 0x011d23d0 Dartfish_Application_EasyCapture_Common_Application_Main_string__ + 152
25 MonoTouchEasyCapture 0x0103ab08 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
26 MonoTouchEasyCapture 0x01870d57 mono_jit_runtime_invoke + 1054
27 MonoTouchEasyCapture 0x018e0abb mono_runtime_invoke + 90
28 MonoTouchEasyCapture 0x018e37f7 mono_runtime_exec_main + 306
29 MonoTouchEasyCapture 0x018e3a4b mono_runtime_run_main + 482
30 MonoTouchEasyCapture 0x01873dbf mono_jit_exec + 94
31 MonoTouchEasyCapture 0x0186e59b main + 2802
32 MonoTouchEasyCapture 0x000029c8 start + 40