Monday, 7 October 2019

Xamarin iOS 13 App Crash Resolution

Coming back to wanting to build the iOS version of an application, I ran into an issue where the application crashed on startup. Before this the following occurred :-

  • Visual Studio 2019 on the Mac was upgraded
  • Visual Studio 2017 on the PC no longer built the application
    • Wanting to downgrade what was on the Mac in terms of Xamarin.iOS version
  • Visual Studio 2019 on the PC was installed
  • iPhone 7 was upgraded to iOS 13
From Debugging, it seemed to be related to prompting for permission of the Location services, which sent me down a certain path, which then lead me to the following thread :-


A post on this thread by sschmidTU pointed me in the direction of viewing the console from the iOS device via XCode :-


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

Having filtered the console output using the application name, I found that the application was crashing because the Bluetooth Permission was being prompted for however I didn't have the NSBluetoothAlwaysUsageDescription key in my Info.plist.

Looking at the documentation for this key, it is new in iOS 13 :-


Once the NSBluetoothAlwaysUsageDescription key was added, the application no longer crashes on startup.

No comments:

Post a Comment