Xamarin.iOS app crashes on startup on iOS13

kinekine FIMember ✭✭

I have severe issue with my Xamarin.iOS app in the AppStore. It started crashing on iOS13 beta. Rebuilding the app with the latest SDKs and tools did not help. Any ideas what is the problem? I don't find anything useful from the crash logs. Anything is of course possible but to me this looks like a high level issue in Xamarin.iOS.

Please see details here: https://stackoverflow.com/questions/57982260/xamarin-ios-app-crashes-on-startup-on-ios13

Tagged:

Answers

  • kinekine FIMember ✭✭

    In the crash log there reads:

        Exception Type:  EXC_BAD_ACCESS (SIGABRT)
        Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000018
    

    Can it still be normal C# / .NET exception which happens or does that indicate some low level crash?

    If there is a C# exception (which I could catch) should I see the exception class or other details in this crash log?

  • supippersupipper Member

    Hi,
    I have a similar problem with an app hosted on Intune. When the app opens, it shows the dark screen after the launch image.
    If I install it from mac, works correctly. No debug errors.
    I hope we find a solution soon.

  • kinekine FIMember ✭✭

    I found the reason for the crash (see https://stackoverflow.com/questions/57982260/xamarin-ios-app-crashes-on-startup-on-ios13). I learnt from this case that with Xamarin you can easily spend days or even weeks on investigating a simple crash issue as those crash logs are pretty useless. At the moment I am investigating other iOS 13 related crashes too, same situation. Reading those crash logs is mostly waste of time. You have to debug issues using some other methods.

  • JigarMJigarM USMember ✭✭

    Hi @kine

    Do you have any update on this issue as I am facing the same issue but the xamarin log is useless. The app always crash on app launch in iOS 13.
    I applied multiple ways to resolve this but still on the same stage.
    Help will be appreciated.

    Thanks in advance.

  • kinekine FIMember ✭✭

    So you cannot reproduce the issue yourself? In that case try something like this:

        public class Application
        {
            static void Main(string[] args)
            {
                try
                {
                    UIApplication.Main(args, null, "AppDelegate");
                }
                catch (Exception ex)
                {
                    // TODO:
                    // Send here the exception details e.g. to Google Analytics or
                    // save exception details to a file and display it to user
                    // on the next startup and ask user to send a screenshot to you.
                }
            }
        }
    

    From what I know it is not possible to display a dialog box in the catch block here because the app is already closing. That's why you should try to show it in the next startup. Show it only once on the next startup and stop app execution there (to prevent the crash when showing the error dialog).

    Also it may be useful to read the application output log when you run your app under the debugger. Even if it doesn't crash in your device the output log may contain some errors or warnings you should fix. I found couple of iOS 13 related issues this way. Check also any compiler warnings.

    You may also find this article useful https://docs.microsoft.com/en-us/xamarin/ios/platform/exception-marshaling

  • sschmidTUsschmidTU Member ✭✭
    edited October 3

    To get console output for a crash like this 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
    type your app name in the search window to filter the output

    I found our exception that way. The crash log posted didn't help, because it's just the apple main thread crashing.

    For us the crash was caused by 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.

    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

Sign In or Register to comment.