locked
App crash after IOS 13 RRS feed

  • Question

  • User44546 posted

    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
    
    Wednesday, September 25, 2019 5:25 PM

Answers

  • User369979 posted

    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;
    }
    
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, September 26, 2019 3:25 AM

All replies

  • User369979 posted

    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;
    }
    
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, September 26, 2019 3:25 AM
  • User44546 posted

    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.

    Saturday, September 28, 2019 9:10 AM
  • User388993 posted

    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

    Thursday, October 3, 2019 10:16 AM
  • User389467 posted

    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:

    0x1049af985 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_dump_native_crash_info
    0x1049a38c5 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_native_crash
    0x1049b6c01 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_sigsegv_signal_handler_debug
    0x7fff51414b5d - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x107692508 - Unknown
    0x1049a276e - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_exception_internal
    0x1049a1849 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_exception
    0x104923659 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : handle_signal_exception
    0x7ffeeb67cfa8 - Unknown
    

    =================================================================

    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 <unknown> <0xffffffff>
      at UIKit.UIApplication:UIApplicationMain <0x00251>
      at UIKit.UIApplication:Main <0x000b2>
      at UIKit.UIApplication:Main <0x00132>
      at CS.iOS.Application:Main <0x00092>
    

    at :runtimeinvokevoid_object <0x00352>

    Thursday, October 3, 2019 12:01 PM
  • User389467 posted

    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:

    0x1049af985 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_dump_native_crash_info
    0x1049a38c5 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_native_crash
    0x1049b6c01 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_sigsegv_signal_handler_debug
    0x7fff51414b5d - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_platform.dylib : _sigtramp
    0x107692508 - Unknown
    0x1049a276e - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_exception_internal
    0x1049a1849 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : mono_handle_exception
    0x104923659 - /Users/cs/Library/Developer/CoreSimulator/Devices/2EBBC182-3DCD-4415-995D-2A2651ABC712/data/Containers/Bundle/Application/EBFBFD6A-D978-4D89-B592-85812E3DF979/CS.iOS.app/CS.iOS : handle_signal_exception
    0x7ffeeb67cfa8 - Unknown
    

    =================================================================

    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 <unknown> <0xffffffff>
      at UIKit.UIApplication:UIApplicationMain <0x00251>
      at UIKit.UIApplication:Main <0x000b2>
      at UIKit.UIApplication:Main <0x00132>
      at CS.iOS.Application:Main <0x00092>
    

    at :runtimeinvokevoid_object <0x00352>

    Thursday, October 3, 2019 12:01 PM
  • User388993 posted

    @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?

    Thursday, October 3, 2019 3:30 PM
  • User389467 posted

    @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.

    Thursday, October 3, 2019 3:57 PM
  • User180958 posted

    @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.

    Monday, April 6, 2020 6:31 AM