Our Xamarin-based iOS app works fine on iPhone but crashes on iPad. The offending call is to SetEnableIO:
audioUnit = new AudioUnit.AudioUnit(component);
audioUnit.SetEnableIO(true, AudioUnitScopeType.Input, kInputBus);
Here is output received in the debug window:
2016-09-20 09:59:19.006 MyAppiOX[329:100987] critical:
Native stacktrace:
2016-09-20 09:59:19.099 MyAppiOX[329:100987] critical: 0 MyAppiOX 0x00000001001b97d8 mono_handle_native_sigsegv + 260
2016-09-20 09:59:19.099 MyAppiOX[329:100987] critical: 1 libsystem_platform.dylib 0x00000001853df348 _sigtramp + 52
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 2 libsystem_kernel.dylib 0x0000000185319480 <redacted> + 100
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 3 libsystem_kernel.dylib 0x00000001853194c8 system_set_sfi_window + 0
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 4 TCC 0x000000018855a560 <redacted> + 0
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 5 TCC 0x000000018855a45c <redacted> + 0
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 6 TCC 0x000000018855d52c <redacted> + 288
2016-09-20 09:59:19.100 MyAppiOX[329:100987] critical: 7 libxpc.dylib 0x000000018542401c <redacted> + 80
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 8 libxpc.dylib
0x0000000185423f8c <redacted> + 40
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 9 libdispatch.dylib 0x00000001851d91c0 <redacted> + 16
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 10 libdispatch.dylib 0x00000001851e7ab4 <redacted> + 732
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 11 libdispatch.dylib 0x00000001851e938c <redacted> + 572
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 12 libdispatch.dylib 0x00000001851e90ec <redacted> + 124
2016-09-20 09:59:19.101 MyAppiOX[329:100987] critical: 13 libsystem_pthread.dylib 0x00000001853e12c8 _pthread_wqthread + 1288
2016-09-20 09:59:19.102 MyAppiOX[329:100987] critical: 14 libsystem_pthread.dylib 0x00000001853e0db4 start_wqthread + 4
2016-09-20 09:59:19.102 MyAppiOX[329:100987] critical:
=================================================================
Got a SIGABRT while executing native code. This usually
indicates a fatal error in the mono runtime or one of the
native libraries used by your application.
Does anyone know How to get around this problem? Regards.
Environment:
Visual Studio 2015 with update 3
Xamarin 4.2.0.680
Xamarin.iOS 10.0.0.6
iPad is running iOS 10.0.1
We finally nailed the problem down. Apparently, Xamarin has not yet been fully tested on iOS 10. The OS has introduced some new privacy settings. If you do not define the settings that your iOS app intends to use, you will see your app crash with SIGABRT errors. The privacy settings can be defined in Info.plist. In our case, it was NSMicrophoneUsageDescription. Hope you find this useful.
Related
I received a crash in iOS12.
The way to reproduce:
1.Play a video with UIWebView, then the video will play in fullScreen.
2.After the video start play, tap the left-top reduced Button to stop the video.
3.Replay it and the video will still in fullScreeen.
4.Repeat step2 and step3 several times.
5.Normal speed, at most 10 times, the crash will come.
Some detail info of the crash:
Hardware Model: iPhone10,3
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Date/Time: 2018-10-08 18:59:20.8570 +0800
Launch Time: 2018-10-08 18:58:58.7757 +0800
OS Version: iPhone OS 12.0 (16A366)
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000047c300000111
VM Region Info: 0x47c300000111 is not in any region. Bytes after previous region: 78891569905938
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_NANO 0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV
--->
UNUSED SPACE AT END
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [658]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 WebCore 0x00000001be5f4270 VideoFullscreenControllerContext::rateChanged+ 4784752 (bool, float) + 308
1 WebCore 0x00000001be5f4164 VideoFullscreenControllerContext::rateChanged+ 4784484 (bool, float) + 40
2 libdispatch.dylib 0x00000001b529b6c8 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x00000001b529c484 _dispatch_client_callout + 16
4 libdispatch.dylib 0x00000001b527bb44 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 1012
5 CoreFoundation 0x00000001b57f21bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6 CoreFoundation 0x00000001b57ed084 __CFRunLoopRun + 1964
7 CoreFoundation 0x00000001b57ec5b8 CFRunLoopRunSpecific + 436
8 GraphicsServices 0x00000001b7a60584 GSEventRunModal + 100
9 UIKitCore 0x00000001e2117558 UIApplicationMain + 212
10 xxxx 0x00000001023d29e4 main + 59876 (main.m:16)
11 libdyld.dylib 0x00000001b52acb94 start + 4
Thread 1 name: JavaScriptCore bmalloc scavenger
Thread 1:
0 libsystem_kernel.dylib 0x00000001b53f8f0c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x00000001b547a4c8 _pthread_cond_wait$VARIANT$armv81 + 620
2 libc++.1.dylib 0x00000001b49c44d0 std::__1::condition_variable::wait+ 34000 (std::__1::unique_lock<std::__1::mutex>&) + 24
3 JavaScriptCore 0x00000001bcb5bd7c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >+ 376188 (std::__1::unique_lock<bmalloc::Mutex>&) + 104
4 JavaScriptCore 0x00000001bcb5fe70 bmalloc::Scavenger::threadRunLoop+ 392816 () + 176
5 JavaScriptCore 0x00000001bcb5f5a4 bmalloc::Scavenger::Scavenger+ 390564 (std::__1::lock_guard<bmalloc::Mutex>&) + 0
6 JavaScriptCore 0x00000001bcb61050 std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer+ 397392 (std::__1::__thread_struct*) + 0
7 libsystem_pthread.dylib 0x00000001b547d2fc _pthread_body + 128
8 libsystem_pthread.dylib 0x00000001b547d25c _pthread_start + 48
9 libsystem_pthread.dylib 0x00000001b5480d08 thread_start + 4
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x00000001b53eded0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001b53ed3a8 mach_msg + 72
2 libdispatch.dylib 0x00000001b526d630 _dispatch_mach_send_and_wait_for_reply + 500
3 libdispatch.dylib 0x00000001b526dad0 dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$armv81 + 56
4 libxpc.dylib 0x00000001b54b4eb4 xpc_connection_send_message_with_reply_sync + 204
5 CoreMedia 0x00000001b8f1176c FigXPCRemoteClientSendSyncMessageCreatingReply + 36
6 MediaToolbox 0x00000001ba4e5868 remoteXPCAsset_GetStatusOfValueForProperty + 152
7 AVFoundation 0x00000001bb954930 -[AVFigAssetInspectorLoader _loadStatusForProperty:figAsset:error:] + 84
8 AVFoundation 0x00000001bb954af4 -[AVFigAssetInspectorLoader statusOfValueForKey:error:] + 312
9 WebCore 0x00000001be232e98 WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus+ 847512 () const + 248
10 WebCore 0x00000001be2213a8 WebCore::MediaPlayerPrivateAVFoundation::updateStates+ 775080 () + 764
11 WebCore 0x00000001be23dcec WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange+ 892140 (double) + 24
12 WebCore 0x00000001be2222bc WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification+ 778940 () + 1064
13 JavaScriptCore 0x00000001bcb273e0 WTF::dispatchFunctionsFromMainThread+ 160736 () + 308
14 Foundation 0x00000001b63135a0 __NSThreadPerformPerform + 336
15 CoreFoundation 0x00000001b57f25b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x00000001b57f2538 __CFRunLoopDoSource0 + 88
17 CoreFoundation 0x00000001b57f1e1c __CFRunLoopDoSources0 + 176
18 CoreFoundation 0x00000001b57ecce8 __CFRunLoopRun + 1040
19 CoreFoundation 0x00000001b57ec5b8 CFRunLoopRunSpecific + 436
20 WebCore 0x00000001be613ba4 RunWebThread+ 4914084 (void*) + 592
21 libsystem_pthread.dylib 0x00000001b547d2fc _pthread_body + 128
22 libsystem_pthread.dylib 0x00000001b547d25c _pthread_start + 48
23 libsystem_pthread.dylib 0x00000001b5480d08 thread_start + 4
Anyone have any idea?
ps.There are a similar question at Multiple UIWebView WebCore Crashes
We have a crash in MetalContext with over 3000 crashes in a single day on iOS 10 devices only. We are unable to track down the root of the error and google reveals nobody else have the same issue. Is there anyone who has any clues to where we can begin to look?
CRASH_INFO_ENTRY_0
Assertion failed: (_mcimpl->device == [_mcimpl->queue device]), function MetalContext, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/QuartzCore/QuartzCore-449.40.9/LayerKit/ogl/ogl-metal.mm, line 1005.
tid_403
0 libsystem_kernel.dylib 0x18d19e8e8 __ulock_wait + 8
1 libdispatch.dylib 0x18d06c0d8 _dispatch_ulock_wait + 48
2 libdispatch.dylib 0x18d06c200 _dispatch_thread_event_wait_slow + 36
3 libdispatch.dylib 0x18d069df8 _dispatch_barrier_sync_f_slow + 236
4 QuartzCore 0x1913e7090 CABackingStoreGetFrontTexture(CABackingStore*) + 92
5 QuartzCore 0x1913e7118 CABackingStorePrepareFrontTexture + 64
6 QuartzCore 0x1914db0a4 CA::Layer::prepare_commit(CA::Transaction*) + 320
7 QuartzCore 0x1914577f8 CA::Context::commit_transaction(CA::Transaction*) + 264
8 QuartzCore 0x19147ec58 CA::Transaction::commit() + 512
9 QuartzCore 0x19147f678 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
10 CoreFoundation 0x18e17b7dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
11 CoreFoundation 0x18e17940c __CFRunLoopDoObservers + 372
12 CoreFoundation 0x18e17989c __CFRunLoopRun + 1024
13 CoreFoundation 0x18e0a8048 CFRunLoopRunSpecific + 444
14 GraphicsServices 0x18fb2e198 GSEventRunModal + 180
15 UIKit 0x1940942fc -[UIApplication _run] + 684
16 UIKit 0x19408f034 UIApplicationMain + 208
17 NDC2010 0x100a321d4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (<unknown>:1)
18 NDC2010 0x1009ae138 Xamarin_iOS_UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
19 NDC2010 0x100526288 NDC2010_NDC2010_NDC2010Application_Main_string__ + 28620
20 NDC2010 0x100921ba4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 4204776
21 Mono 0x1019aa4e8 mono_jit_runtime_invoke + 1772
22 Mono 0x101a1ad64 do_runtime_invoke + 112
23 Mono 0x101a1d348 mono_runtime_exec_main + 832
24 Mono 0x101a1cf64 mono_runtime_run_main + 764
25 Mono 0x10198eb04 mono_jit_exec + 236
26 NDC2010 0x10051ed3c xamarin_main (monotouch-main.m:487)
27 NDC2010 0x101291970 main (main.arm64.m:133)
28 libdispatch.dylib 0x18d08c5b8 (Missing)
My app kept crashing with the same log, what fixed for me was a quick reset of device, i traced it to webView usage. I cant reset device every time so further testing revealed that i was using xcode 7.3 to build for ios10 that was the problem, after updating to xcode 8 and rebuilding the app i no longer get this crash. Hope this helps
I'm trying to implement the code on the below link
Recording with AudioQueue and Monotouch static sound
to use the microphone to record sounds from the microphone and the app is constantly crashing with the below stack trace:
critical:
Native stacktrace:
2016-10-04 15:41:51.119 JUser[3163:1136833] critical: 0 JUser 0x000000010012bd68 mono_handle_native_sigsegv + 260
2016-10-04 15:41:51.119 JUser[3163:1136833] critical: 1 libsystem_platform.dylib 0x0000000192cff348 _sigtramp + 52
2016-10-04 15:41:51.119 JUser[3163:1136833] critical: 2 libsystem_kernel.dylib 0x0000000192c39480 <redacted> + 100
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 3 libsystem_kernel.dylib 0x0000000192c394c8 system_set_sfi_window + 0
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 4 TCC 0x0000000195e7a560 <redacted> + 0
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 5 TCC 0x0000000195e7a45c <redacted> + 0
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 6 TCC 0x0000000195e7d52c <redacted> + 288
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 7 libxpc.dylib 0x0000000192d4401c <redacted> + 80
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 8 libxpc.dylib 0x0000000192d43f8c <redacted> + 40
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 9 libdispatch.dylib 0x0000000192af91c0 <redacted> + 16
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 10 libdispatch.dylib 0x0000000192b07ab4 <redacted> + 732
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 11 libdispatch.dylib 0x0000000192b0938c <redacted> + 572
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 12 libdispatch.dylib 0x0000000192b090ec <redacted> + 124
2016-10-04 15:41:51.120 JUser[3163:1136833] critical: 13 libsystem_pthread.dylib 0x0000000192d012c8 _pthread_wqthread + 1288
2016-10-04 15:41:51.121 JUser[3163:1136833] critical: 14 libsystem_pthread.dylib 0x0000000192d00db4 start_wqthread + 4
2016-10-04 15:41:51.121 JUser[3163:1136833] critical:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
I tried to wrap the code in try catch but still experiencing crashes. Any idea what might be the issue?
I found the solution in case someone else faces the same issue .You will need to add [Privacy -Microphone Usage Description] property to the info.list with a text description so that the app will ask you to allow access to use the microphone .
I am trying to test out the new Google SDK for iOS using the GoogleMapsSample on GitHub, however, every time I run the app crashes trying to create an instance of GMSMapView. This is happening when trying to run on both the simulator and the device.
I have enabled the SDK from the developer console and updated the GMSServices.ProvideAPIKey call to use my iOS API key, from what I have read that is pretty much all that's required?
I did notice this bug which was logged against the actual SDK which mentions an issue relating to OpenGL so not sure if that's what the issue is here. However, as I can't get access to a log using the simulator I ran it on the device and checked the log out using XCode and the error does seem to relate to this - stack trace:
Incident Identifier: {Incident Id}
CrashReporter Key: {CrashReporter key}
Hardware Model: iPhone5,2
Process: GoogleMapsSample [6085]
Path: /var/mobile/Applications/{AppId}/GoogleMapsSample.app/GoogleMapsSample
Identifier: GoogleMapsSample
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-02-27 18:28:21.300 +0000
OS Version: iOS 6.0.2 (10A551)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000180
Crashed Thread: 6
Last Exception Backtrace:
0 CoreFoundation 0x372913e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x33cc995e objc_exception_throw + 26
2 CoreData 0x32330828 +[NSEntityDescription entityForName:inManagedObjectContext:] + 100
3 GoogleMapsSample 0x0010a3c6 -[GMSTileDataCache fetchTilesImmediateWithPredicate:sortDescriptor:completionHandler:] (GMSTileDataCache.mm:794)
4 GoogleMapsSample 0x00106af0 __47-[GMSTileDataCache startWithCompletionHandler:]_block_invoke_0 (GMSTileDataCache.mm:170)
5 libdispatch.dylib 0x3096478e _dispatch_call_block_and_release + 6
6 libdispatch.dylib 0x30967b36 _dispatch_queue_drain + 138
7 libdispatch.dylib 0x30965678 _dispatch_queue_invoke + 40
8 libdispatch.dylib 0x3096860e _dispatch_root_queue_drain + 206
9 libdispatch.dylib 0x309687d4 _dispatch_worker_thread2 + 88
10 libsystem_c.dylib 0x3337f7ec _pthread_wqthread + 356
11 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 dyld 0x2fe9bcf6 ImageLoaderMachOCompressed::trieWalk(unsigned char const*, unsigned char const*, char const*) + 42
1 dyld 0x2fe9be88 ImageLoaderMachOCompressed::findExportedSymbol(char const*, ImageLoader const**) const + 72
2 dyld 0x2fe96ca4 ImageLoaderMachO::findExportedSymbol(char const*, bool, ImageLoader const**) const + 28
3 dyld 0x2fe93592 ImageLoader::findExportedSymbolInDependentImagesExcept(char const*, ImageLoader const**, ImageLoader const**&, ImageLoader const**, ImageLoader const**) const + 50
4 dyld 0x2fe936f0 ImageLoader::findExportedSymbolInImageOrDependentImages(char const*, ImageLoader::LinkContext const&, ImageLoader const**) const + 64
5 dyld 0x2fe91d12 dlsym + 474
6 libdyld.dylib 0x37ad79c6 dlsym + 54
7 libGFXShared.dylib 0x3362e5c4 gfxInitializeLibrary + 1256
8 GLEngine 0x379bce6a gliInitializeLibrary + 42
9 OpenGLES 0x36a9fa4e eagl_init + 418
10 OpenGLES 0x36a9f6a4 -[EAGLSharegroup initWithAPI:sharedWithCompute:] + 116
11 OpenGLES 0x36a9e45e -[EAGLContext initWithAPI:properties:] + 186
12 OpenGLES 0x36a9e2f2 -[EAGLContext initWithAPI:sharedWithCompute:] + 138
13 GoogleMapsSample 0x00081ada -[GMSIOSGLContext initWithAPI:] (GMSIOSGLContext.mm:14)
14 GoogleMapsSample 0x001275b6 gmscore::renderer::GMSIOSGLContextPool::GMSIOSGLContextPool() (GLContextPool.mm:108)
15 GoogleMapsSample 0x0012733a __GetGLContextPool_block_invoke_0 (GLContextPool.mm:204)
16 libdispatch.dylib 0x309645d8 _dispatch_client_callout + 20
17 libdispatch.dylib 0x30965586 dispatch_once_f + 42
18 GoogleMapsSample 0x001272da gmscore::renderer::GLContextPool::GetGLContextPool() (once.h:68)
19 GoogleMapsSample 0x00142b60 -[GMSEntityRendererView initWithFrame:context:] (GMSEntityRendererView.mm:53)
20 GoogleMapsSample 0x001562be -[GMSGestureHandlerView initWithFrame:context:gestures:] (GMSGestureHandlerView.mm:282)
21 GoogleMapsSample 0x000fc6d6 -[GMSVectorMapView initWithFrame:connection:tileServiceRegistry:tileRequestCoordinator:serverControlledParameters:resourceManager:resources:networkMonitor:context:flags:locationPipeline:] (GMSVectorMapView.mm:245)
22 GoogleMapsSample 0x00097bc6 -[GMSVectorMapViewBridge sharedInit:] (GMSVectorMapViewBridge.mm:108)
23 GoogleMapsSample 0x000977f0 -[GMSVectorMapViewBridge initWithFrame:camera:] (GMSVectorMapViewBridge.mm:84)
24 GoogleMapsSample 0x00080caa +[GMSMapView mapWithFrame:camera:] (GMSMapView.m:36)
25 GoogleMapsSample 0x00183058 wrapper_managed_to_native_ApiDefinition_Messaging_IntPtr_objc_msgSend_RectangleF_GMSCamera_intptr_intptr_System_Drawing_RectangleF_GoogleMaps_GMSCamera + 456
26 GoogleMapsSample 0x004ff57c GoogleMapsSample_MapViewController_LoadView (MapViewController.cs:21)
27 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
28 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
29 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
30 GoogleMapsSample 0x018d9816 native_to_managed_trampoline_GoogleMapsSample_MapViewController_LoadView (registrar.m:10129)
31 UIKit 0x3805d41c -[UIViewController loadViewIfRequired] + 64
32 UIKit 0x3809dd2c -[UIWindow addRootViewControllerViewIfPossible] + 60
33 UIKit 0x38099ac8 -[UIWindow _setHidden:forced:] + 360
34 UIKit 0x380db19c -[UIWindow makeKeyAndVisible] + 56
35 GoogleMapsSample 0x01549600 wrapper_managed_to_native_MonoTouch_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr + 64
36 GoogleMapsSample 0x004ff22c GoogleMapsSample_AppDelegate_FinishedLaunching_MonoTouch_UIKit_UIApplication_MonoTouch_Foundation_NSDictionary (AppDelegate.cs:35)
37 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
38 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
39 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
40 GoogleMapsSample 0x018c9608 native_to_managed_trampoline_GoogleMapsSample_AppDelegate_FinishedLaunching (registrar.m:5515)
41 UIKit 0x3809ea74 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
42 UIKit 0x3809e5f8 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1164
43 UIKit 0x38096806 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
44 UIKit 0x3803ecea -[UIApplication handleEvent:withNewEvent:] + 1006
45 UIKit 0x3803e778 -[UIApplication sendEvent:] + 68
46 UIKit 0x3803e1ba _UIApplicationHandleEvent + 6194
47 GraphicsServices 0x315235f4 _PurpleEventCallback + 588
48 GraphicsServices 0x31523222 PurpleEventCallback + 30
49 CoreFoundation 0x372663e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
50 CoreFoundation 0x37266386 __CFRunLoopDoSource1 + 134
51 CoreFoundation 0x3726520a __CFRunLoopRun + 1378
52 CoreFoundation 0x371d8238 CFRunLoopRunSpecific + 352
53 CoreFoundation 0x371d80c4 CFRunLoopRunInMode + 100
54 UIKit 0x38095440 -[UIApplication _run] + 664
55 UIKit 0x3809228c UIApplicationMain + 1116
56 GoogleMapsSample 0x01576fa8 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 236
57 GoogleMapsSample 0x004fef5c GoogleMapsSample_Application_Main_string__ (Main.cs:17)
58 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
59 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
60 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
61 GoogleMapsSample 0x0195e3aa mono_runtime_exec_main (object.c:3972)
62 GoogleMapsSample 0x01961cce mono_runtime_run_main (object.c:3602)
63 GoogleMapsSample 0x01905be6 mono_jit_exec (driver.c:1125)
64 GoogleMapsSample 0x019ae5f4 main (main.m:445)
65 GoogleMapsSample 0x0016d20c start + 36
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x378c25d0 kevent64 + 24
1 libdispatch.dylib 0x30969d22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x30965374 _dispatch_mgr_thread + 32
Thread 2:
0 libsystem_kernel.dylib 0x378d2d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3337fad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3337f7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x378c1e80 semaphore_wait_trap + 8
1 GoogleMapsSample 0x01900992 mono_sem_wait (mono-semaphore.c:115)
2 GoogleMapsSample 0x019a0cea finalizer_thread (gc.c:1078)
3 GoogleMapsSample 0x0198bff6 start_wrapper (threads.c:784)
4 GoogleMapsSample 0x018f3942 thread_start_routine (wthreads.c:287)
5 GoogleMapsSample 0x019392dc GC_start_routine (pthread_support.c:1468)
6 libsystem_c.dylib 0x3338a0de _pthread_start + 306
7 libsystem_c.dylib 0x33389fa4 thread_start + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x378c1e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x378c1fd0 mach_msg + 48
2 CoreFoundation 0x372662b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x3726502c __CFRunLoopRun + 900
4 CoreFoundation 0x371d8238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x371d80c4 CFRunLoopRunInMode + 100
6 WebCore 0x38ef9a58 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3338a0de _pthread_start + 306
8 libsystem_c.dylib 0x33389fa4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x378d2d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3337fad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3337f7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 6 name: Dispatch queue: com.google.maps.TileDataCacheQueue
Thread 6 Crashed:
0 libsystem_kernel.dylib 0x378d2350 __pthread_kill + 8
1 libsystem_c.dylib 0x333a7fb2 pthread_kill + 54
2 libsystem_c.dylib 0x333e4366 abort + 90
3 GoogleMapsSample 0x019330a4 mono_handle_native_sigsegv (mini-exceptions.c:2325)
4 GoogleMapsSample 0x018ea55e mono_sigsegv_signal_handler (mini.c:5878)
5 libsystem_c.dylib 0x333b1d38 _sigtramp + 40
6 GoogleMapsSample 0x01994b34 mono_domain_get (domain.c:1818)
7 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
8 GoogleMapsSample 0x019c0058 monotouch_throw_monotouch_exception (monotouch-glue.m:1420)
9 GoogleMapsSample 0x019c00e8 monotouch_exception_handler (monotouch-glue.m:1426)
10 CoreFoundation 0x372916cc __handleUncaughtException + 624
11 libobjc.A.dylib 0x33cc9a46 _ZL15_objc_terminatev + 126
12 libc++abi.dylib 0x361ee118 _ZL19safe_handler_callerPFvvE + 76
13 libc++abi.dylib 0x361ee1b0 std::terminate() + 16
14 libc++abi.dylib 0x361ef59a __cxa_throw + 118
15 libobjc.A.dylib 0x33cc999e objc_exception_throw + 90
16 CoreData 0x32330828 +[NSEntityDescription entityForName:inManagedObjectContext:] + 100
17 GoogleMapsSample 0x0010a3c6 -[GMSTileDataCache fetchTilesImmediateWithPredicate:sortDescriptor:completionHandler:] (GMSTileDataCache.mm:794)
18 GoogleMapsSample 0x00106af0 __47-[GMSTileDataCache startWithCompletionHandler:]_block_invoke_0 (GMSTileDataCache.mm:170)
19 libdispatch.dylib 0x30964790 _dispatch_call_block_and_release + 8
20 libdispatch.dylib 0x30967b36 _dispatch_queue_drain + 138
21 libdispatch.dylib 0x30965678 _dispatch_queue_invoke + 40
22 libdispatch.dylib 0x30968610 _dispatch_root_queue_drain + 208
23 libdispatch.dylib 0x309687d4 _dispatch_worker_thread2 + 88
24 libsystem_c.dylib 0x3337f7ee _pthread_wqthread + 358
25 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 6 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3a484524
r4: 0x00000006 r5: 0x0aa4c000 r6: 0x01a14b1e r7: 0x0aa4af9c
r8: 0x00000000 r9: 0x3a480898 r10: 0x01a14b44 r11: 0x05a9385c
ip: 0x00000148 sp: 0x0aa4af90 lr: 0x333a7fb7 pc: 0x378d2350
cpsr: 0x00000010
Version info:
Mono 2.10.11 (mono-2-10/2baeee2)
GTK 2.24.14
GTK# (2.12.0.0)
Package version: 210110000
Xcode 4.5.1 (1842)
Build 4G1004
Monotouch: 6.2.0.65
Any ideas?
Update #2
Google suggested a workaround and it has been implemented. I have successfully deployed to device :) you can find the working solution on MonoTouch-Bindings Repo
Google will fix this on their upcoming release as stated here.
Happy Coding
Update
There is a bug on Google Maps that makes it impossible to use it in Xamarin.iOS, this bug has been reported to google here
http://code.google.com/p/gmaps-api-issues/issues/detail?id=5018
Please Star it so google notices and fixes it faster ;)
I have updated the bindings to version 1.1.0 of Google Maps you can find them here https://github.com/mono/monotouch-bindings/tree/master/GoogleMaps
Please note I have not updated the sample to reflect the Api changes yet.
Hope this helps
Alex
Xamarin did not update to the newer version since they did the last update on 14 december. I believe that this crash relates to this issue. Maybe the API keys you can generate today are just build for 1.1.0 and newer.
I get a very infrequent crash when stopping MKMapView location services in the applicationDidEnterBackground method. (I'm doing this to ensure that my app does not use location services when the app is in the background.)
The code which gives rise to the crash looks like this:
- (void)MyAppDelegate applicationDidEnterBackground:(UIApplication *app) {
[self.baseAppViewController stopUserTracking];
}
The stopUserTracking method does the following:
-(void)stopUserTracking {
[baseAppViewController.mapView setUserTrackingMode:MKUserTrackingModeNone];
[baseAppViewController.mapView setShowsUserLocation:NO];
}
Note that the baseAppViewController is never released by the app; neither is the mapView. The baseAppViewController is the delegate of its mapView. The delegate is never set to nil.
Here is the stack trace, which ends with a call to MKNormalizedPointForLayer. I've read elsewhere that the MKNormalizedPointForLayer may be due to an invalid annotation latlng (http://stackoverflow.com/questions/9766272/error-in-main-thread-mknormalizedpointforlayer). However I doubt that this is the case for my app: I've tried purposefully adding annotations with invalid lat/lngs, and don't get this error. The fact that this is happening as a result of the MKTilesRequireGoogleLegalNotices call is intriguing, but completely puzzling. Any thoughts?
Thread 0 Crashed:
0 MapKit 0x32b5de94 MKNormalizedPointForLayer + 28043
1 MapKit 0x32b5dd8f MKNormalizedPointForLayer + 27782
2 MapKit 0x32b5dca3 MKNormalizedPointForLayer + 27546
3 MapKit 0x32b6b901 MKTilesRequireGoogleLegalNotices + 44500
4 MapKit 0x32b69eed MKTilesRequireGoogleLegalNotices + 37824
5 MapKit 0x32b50673 MKTileSupportsTileSetStyle + 15378
6 MyApp 0x00040061 -[BaseAppViewController stopUserTracking] (BaseAppViewController.m:785)
7 MyApp 0x0001e3c9 -[MyAppDelegate applicationDidEnterBackground:] (MyAppDelegate.m:325)
8 UIKit 0x334fd235 -[UIApplication _handleApplicationSuspend:eventInfo:] + 760
9 UIKit 0x3348deff -[UIApplication handleEvent:withNewEvent:] + 2094
10 UIKit 0x3348d567 -[UIApplication sendEvent:] + 54
11 MyApp 0x000fcb41 -[UIApplication(HMCustom) customSendEvent:] + 85
12 UIKit 0x3348cf3b _UIApplicationHandleEvent + 5826
13 GraphicsServices 0x3764c22b PurpleEventCallback + 882
14 CoreFoundation 0x35a2d523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
15 CoreFoundation 0x35a2d4c5 __CFRunLoopDoSource1 + 140
16 CoreFoundation 0x35a2c313 __CFRunLoopRun + 1370
17 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
18 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
19 GraphicsServices 0x3764b439 GSEventRunModal + 136
20 UIKit 0x334bbcd5 UIApplicationMain + 1080
21 MyApp 0x000026d3 main (main.m:27)
Thread 1:
0 libsystem_kernel.dylib 0x362ff3a8 kevent + 24
1 libdispatch.dylib 0x348e9c29 _dispatch_mgr_wakeup + 0
Thread 2:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 WebCore 0x318aeca3 _ZL12RunWebThreadPv + 402
6 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 3:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 MyApp 0x00033823 LoggerWorkerThread (LoggerClient.m:494)
6 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 4:
0 libsystem_kernel.dylib 0x3630f570 __select + 20
1 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 5:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 Foundation 0x354e8bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 308
6 Foundation 0x354e8a81 -[NSThread main] + 72
7 Foundation 0x3557c591 __NSThread__main__ + 1048
8 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 6:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 MapKit 0x32b4de1d MKTileSupportsTileSetStyle + 5052
6 Foundation 0x354e8a81 -[NSThread main] + 72
7 Foundation 0x3557c591 __NSThread__main__ + 1048
8 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 7:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 MyApp 0x0007e78b +[ASIHTTPRequest runRequests] + 171
6 Foundation 0x354e8a81 -[NSThread main] + 72
7 Foundation 0x3557c591 __NSThread__main__ + 1048
8 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 8:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 WebCore 0x318d80d9 _ZN7WebCoreL15runLoaderThreadEPv + 128
6 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 9:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 10:
0 libsystem_c.dylib 0x32e16cc8 start_wqthread + 0
Thread 11:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 12:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 13:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 14:
0 libsystem_kernel.dylib 0x362ff004 mach_msg_trap + 20
1 CoreFoundation 0x35a2d3f3 __CFRunLoopServiceMachPort + 126
2 CoreFoundation 0x35a2c12b __CFRunLoopRun + 882
3 CoreFoundation 0x359af4a5 CFRunLoopRunSpecific + 300
4 CoreFoundation 0x359af36d CFRunLoopRunInMode + 104
5 Foundation 0x354dcb75 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 256
6 MyApp 0x0011d50d +[FlurryHTTPEater sendMethod:to:body:headerFields:timeoutInterval:useWebView:] (FlurryHTTPEater.m:67)
7 MyApp 0x00126ae9 +[FlurrySession sendSessionsToServerWithTimeout:useWebView:requestAppCircleAds:requestVideoAds:requestAppSpotAds:requestReengageAds:sendCurrentSession:] (FlurrySession.m:1053)
8 MyApp 0x001265c7 +[FlurrySession sendSessionsToServerForAppCircle] (FlurrySession.m:1016)
9 Foundation 0x354e8a81 -[NSThread main] + 72
10 Foundation 0x3557c591 __NSThread__main__ + 1048
11 libsystem_c.dylib 0x32e1c735 _pthread_start + 320
Thread 15:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 16:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 17:
0 libsystem_kernel.dylib 0x3630fcd4 __workq_kernreturn + 8
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x41a00000
r4: 0x003b3520 r5: 0x003b3520 r6: 0xfffffffc r7: 0x2fea761c
r8: 0x3f01fae8 r9: 0x00000000 r10: 0x0eaec170 r11: 0x3f485f10
ip: 0xbff00000 sp: 0x2fea7610 lr: 0x32b548ef pc: 0x32b5de94
cpsr: 0x20080030
Binary Images:
(truncated)
I am not 100% sure that it can be that, but your problem might come from a "delegate" problem.
Try to call this line in your method stopUserTracking :
baseAppViewController.mapView.delegate = nil;
This should prevent the map from sending information to deallocated instance of your view controller, causing your app to crash.
Be sure to add this line when your app is reloading from background (maybe in viewWillAppear ?) to make sure your app behaves correctly :
baseAppViewController.mapView.delegate = self;
If it does not solve your problem, try to enable "Zombie object" in the options of your configurations as mentioned here : How do I set up NSZombieEnabled in Xcode 4? it oftens helps to understand what's happening when such unexpected errors happens in apps.