question

JassimAlRahma-9056 avatar image
0 Votes"
JassimAlRahma-9056 asked WenyanZhang-MSFT edited

Crashlytics not logging in iOS app

Hi,

I have Xamarin Forms and I am trying to use Crashlytics. It works perfectly on my Android app but on iOS it does not log anything and I am not getting any error.

In my AppDelegate:

 Firebase.Core.App.Configure();
 Firebase.Crashlytics.Crashlytics.SharedInstance.SendUnsentReports();



dotnet-csharpdotnet-xamarinformsdotnet-ios
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

May I ask do you add GoogleService-Info.plist file to your app project? You could check it.
For more information , you could refer to https://github.com/xamarin/GoogleApisForiOSComponents/blob/main/docs/Firebase/Crashlytics/GettingStarted.md




0 Votes 0 ·

GoogleService-Info.plist was already added in my iOS project

0 Votes 0 ·
WenyanZhang-MSFT avatar image WenyanZhang-MSFT EmiratesAngels-2374 ·

@JassimAlRahma-9056 May I know whether your issue has been solved or not? If not, please share it in here. We can work together to figure it out.

0 Votes 0 ·

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered

Hello,

Welcome to our Microsoft Q&A platform!

You could try to add the following code, the Init method is necessary:

     Firebase.Core.App.Configure();
     Crashlytics.SharedInstance.Init();
     Crashlytics.SharedInstance.SetCrashlyticsCollectionEnabled(true);
     Crashlytics.SharedInstance.SendUnsentReports();

I test an out-of-bounds crash of an array.

 private void Button_Clicked(object sender, EventArgs e)
         {
             var list = new List<string>
             {
                 "11111",
                 "2",
                 "3",
                 "4",
                 "5",
                 "6",
                 "7",
             };
             for (int i = 0; i < 10; i++)
             {
                 Console.WriteLine("{0}",list[i]);
             }
         }

In the dashboard, I see an error " This app has 2 unprocessed crash issues. Please upload 2 dSYM files to handle the crash. " It means that the crash can be reported to Crashlytics Dashboard, but I didn't upload the dSYM files. You may not encounter this issue if you upload a dSYM file.

For more information, you could refer to
https://github.com/xamarin/GoogleApisForiOSComponents/blob/main/docs/Firebase/Crashlytics/GettingStarted.md
https://github.com/xamarin/GoogleApisForiOSComponents/blob/main/source/Firebase/Crashlytics/readme.txt
https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=ios#check-xcode
https://docs.microsoft.com/en-us/answers/questions/235971/upload-1-missing-dsym-required-to-process-12-crash.html

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.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.