Crashlytics not logging in iOS app

Jassim Al Rahma 1,526 Reputation points
2021-11-18T16:41:03.257+00:00

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();
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,295 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,278 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,451 Reputation points Microsoft Vendor
    2021-11-22T08:46:49.963+00:00

    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://learn.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.

    0 comments No comments