My app is crashing on startup after iOS 13. After some debugging I found that calling Start() on a System.Timers.Timer in AppDelegate causes the app to crash. This never happened before iOS 13. What can I do to fix this ??
================================================================= Native Crash Reporting ================================================================= 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. ================================================================= ================================================================= Basic Fault Adddress Reporting ================================================================= Memory around native instruction pointer (0x1a922395c):0x1a922394c c0 03 5f d6 c0 03 5f d6 30 41 80 d2 01 10 00 d4 .._..._.0A...... 0x1a922395c e3 00 00 54 fd 7b bf a9 fd 03 00 91 ed 7e ff 97 ...T.{.......~.. 0x1a922396c bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6 .....{...._..._. 0x1a922397c d0 03 80 d2 01 10 00 d4 e3 00 00 54 fd 7b bf a9 ...........T.{.. ================================================================= Native stacktrace: ================================================================= 0x1062b751c - /private/var/containers/Bundle/Application/D6EA19A4-30BC-468C-A3AD-76C8119486ED/NorskRadioIos.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info 0x1062ad388 - /private/var/containers/Bundle/Application/D6EA19A4-30BC-468C-A3AD-76C8119486ED/NorskRadioIos.app/libmonosgen-2.0.dylib : mono_handle_native_crash 0x1a9142434 - /usr/lib/system/libsystem_platform.dylib : <redacted> 0x1a9227f6c - /usr/lib/system/libsystem_kernel.dylib : <redacted> 0x1a9227fa0 - /usr/lib/system/libsystem_kernel.dylib : <redacted> 0x1af66bbe8 - /System/Library/PrivateFrameworks/TCC.framework/TCC : <redacted> 0x1af66bb24 - /System/Library/PrivateFrameworks/TCC.framework/TCC : <redacted> 0x1af66fd58 - /System/Library/PrivateFrameworks/TCC.framework/TCC : <redacted> 0x1a90437c4 - /usr/lib/system/libxpc.dylib : <redacted> 0x1a9037284 - /usr/lib/system/libxpc.dylib : <redacted> 0x1a90e1094 - /usr/lib/system/libdispatch.dylib : <redacted> 0x1a90f8ed4 - /usr/lib/system/libdispatch.dylib : <redacted> 0x1a90f0870 - /usr/lib/system/libdispatch.dylib : <redacted> 0x1a9146ad8 - /usr/lib/system/libsystem_pthread.dylib : _pthread_wqthread 0x1a914cc78 - /usr/lib/system/libsystem_pthread.dylib : start_wqthread
It seems this error is caused by your native code and the exception is not enough to find out what it is.
I try to place a timer in the FinishedLaunching
like:
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { System.Timers.Timer timer = new System.Timers.Timer(2000); timer.Elapsed += (sender, e) => { }; timer.Start(); return true; }
It works fine.
If you want to consume timer on native iOS project you can try NSTimer:
NSTimer timer; public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { timer = NSTimer.CreateScheduledTimer(2, true, (sender) => { }); return true; }
Answers
It seems this error is caused by your native code and the exception is not enough to find out what it is.
I try to place a timer in the
FinishedLaunching
like:It works fine.
If you want to consume timer on native iOS project you can try NSTimer:
Thanks. It seems to be something else. Only the crash happen after that line of code. Problem is, the damn thing works fine in the simulator.
For us the crash was for using a deprecated class, namely UISearchDisplayController, which should be replaced by UISearchController.
It continued to work in iOS12, but not in iOS13. It was deprecated in iOS8 though i think, so fair enough.
Also, to get console output for your crash on a release version on device:
connect your device to your Mac
open XCode
go to Window -> Devices and Simulators
click Open Console for your device
in the Console, type your app name in the search window to filter the output.
I found the exception that way.
You may have to upload the app to App Store Connect and run it via TestFlight to see the logs, not sure.
Also, this is probably irrelevant, but go to your iPhone settings -> privacy -> Analytics -> Share with App Developers and Share iPhone Analytics
Hello,
My app is also crashing when I am trying to upload multiple images from gallery using GMImagePicker library. Can you suggest me a fix please?
=================================================================
Native Crash Reporting
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.
=================================================================
Native stacktrace:
=================================================================
Basic Fault Address Reporting
Memory around native instruction pointer (0x104a98a54):0x104a98a44 8b 47 1c 5d c3 0f 1f 80 00 00 00 00 55 48 89 e5 .G.]........UH..
0x104a98a54 8b 47 20 a9 00 00 00 02 75 0c a9 00 00 00 10 75 .G .....u......u
0x104a98a64 26 48 8b 07 5d c3 48 8d 3d 89 1f 1f 00 48 8d 35 &H..].H.=....H.5
0x104a98a74 e9 1a 1f 00 48 8d 0d 5d 1b 1f
00 ba 79 03 00 00 ....H..]....y...
=================================================================
Managed Stacktrace:
at :runtime_invoke_void_object <0x00352>
Hello,
My app is also crashing when I am trying to upload multiple images from gallery using GMImagePicker library. Can you suggest me a fix please?
=================================================================
Native Crash Reporting
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.
=================================================================
Native stacktrace:
=================================================================
Basic Fault Address Reporting
Memory around native instruction pointer (0x104a98a54):0x104a98a44 8b 47 1c 5d c3 0f 1f 80 00 00 00 00 55 48 89 e5 .G.]........UH..
0x104a98a54 8b 47 20 a9 00 00 00 02 75 0c a9 00 00 00 10 75 .G .....u......u
0x104a98a64 26 48 8b 07 5d c3 48 8d 3d 89 1f 1f 00 48 8d 35 &H..].H.=....H.5
0x104a98a74 e9 1a 1f 00 48 8d 0d 5d 1b 1f
00 ba 79 03 00 00 ....H..]....y...
=================================================================
Managed Stacktrace:
at :runtime_invoke_void_object <0x00352>
@IshaP did you try surrounding your code with try/catch and looking at the console output like i wrote above?
Did you debug your app step by step? What is the exact line of code where it crashes?
@sschmidTU I debugged it and managed to found the reason that was crashing the app. According to this link (https://stackoverflow.com/questions/57202965/phimageresultisdegradedkey-phimagefileurlkey-is-not-found) I was trying to get the fileURL of an image using PHImageFileURLKey which is not available in iOS 13. So now I am using PHContentEditingInputRequestOptions to retrive the fileURL which seems to be working fine.
@LandLu : You Solution worked for me. But Do you know, what's the reason behind it!! And how did you came to know that this is the fix!! This is strange. But I would surely like to say a big thanks to you, which saved my some hours or in fact some days in worst case.