AppDelegate IOS crashed in Xamarin C#

Sanjay Kumar Jha 156 Reputation points
2022-09-08T14:51:49.873+00:00

Hi,

I am facing issue when I am using iPhone for debugging. application gets crashed in AppDelegate.It is also not showing any kind of exception.Attaching screenshot and samplecode.

Sample Code Link:-

https://drive.google.com/file/d/1Oo4v3VvzXCyT3nwzfaAmGuk1vjBEo_FV/view?usp=sharing

239097-iosexception.png

Developer technologies .NET Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-09-09T08:21:58.207+00:00

    Hello @Sanjay Kumar Jha ,

    It works on simulator, but it doesn't work when I try to run the app on my iPhone, the Native Crash Reporting and Native stacktrace show that " /System/Library/PrivateFrameworks/TCC.framework/TCC : <redacted> ". This crash is related to protecting app access to user data.

    As noted in Core Bluetooth | Apple Developer Documentation - Your app will crash if its Info.plist doesn’t include usage description keys for the types of data it needs to access. You could open the info.plist file , then add the NSBluetoothAlwaysUsageDescription key and NSBluetoothPeripheralUsageDescription key. NSBluetoothPeripheralUsageDescription is deprecate, you don't have to add it if the deployment target of your app is iOS 13 and later.

    Privacy - Bluetooth Peripheral Usage Description - A message that tells the user why the app is requesting the ability to connect to Bluetooth peripherals.
    Privacy - Bluetooth Always Usage Description - A message that tells the user why the app needs access to Bluetooth.

    In addition, please try to delete the bin/obj folder, uninstall the app from your device and deploy again.
    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.