Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Logs Not Generating in .NET MAUI iOS App Using Firebase Crashlytics #22122

Closed
vsfeedback opened this issue Feb 7, 2025 · 2 comments
Closed
Labels
need-repro Waiting for a test case before the bug can be investigated

Comments

@vsfeedback
Copy link

vsfeedback commented Feb 7, 2025

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
I am experiencing an issue where crash logs are not being generated in my .NET 8.0 MAUI iOS application. I am using the latest version of Xamarin.Firebase.iOS.Crashlytics (8.10.0.3) for Firebase Crash Analytics. Despite implementing the setup as documented, crashes are not being reported to Firebase.

Environment Details:

  • Framework: .NET 8.0
  • Firebase Crashlytics Library: Xamarin.Firebase.iOS.Crashlytics v8.10.0.3
  • Platform: iOS

MAUI Configuration: Below is the code used to register Firebase services in MauiProgram.cs:

private static MauiAppBuilder RegisterFirebase(this MauiAppBuilder builder)
    {
        try
        {
            builder. ConfigureLifecycleEvents(events =>
          {
#if IOS
              events. AddiOS(iOS => iOS.FinishedLaunching((app, launchOptions) =>
              {
                  Firebase.Core.App.Configure();
                  Firebase.Crashlytics.Crashlytics.SharedInstance.Init();
                  Firebase.Crashlytics.Crashlytics.SharedInstance.SetCrashlyticsCollectionEnabled(true);
                  Firebase.Crashlytics.Crashlytics.SharedInstance.SendUnsentReports();
                  return false;
              }));
#else
            events. AddAndroid(android => android. OnCreate((activity, bundle) => {
                Firebase.FirebaseApp.InitializeApp(activity);
            }));
#endif
          });

return builder;
        }
        catch (Exception ex)
        {

Console.WriteLine($"Message  ==================:- {ex. Message}");
            Console.WriteLine($"StackTrace ====================== :- {ex. StackTrace}");
            Console.WriteLine($"InnerException =======================:- {ex. InnerException}");
            throw;
        }
    }

Steps to Reproduce:
1.Create a new .NET MAUI project targeting iOS.
2.Add the Xamarin.Firebase.iOS.Crashlytics NuGet package (v8.10.0.3).
3.Implement Firebase Crashlytics initialization in MauiProgram.cs as shown above.
4.Trigger a crash in the app using:

Firebase.Crashlytics.Crashlytics.SharedInstance.Log("Testing crash.");
throw new Exception("Test crash");
  1. Observe that no crash logs appear in the Firebase Console.

Expected Behavior:
Crash logs should appear in the Firebase Console after the app crashes.

Additional Information:
The issue occurs only on iOS; Android appears to function correctly.
No error or warning logs related to Firebase Crashlytics are observed in the app output.

Request:
I would appreciate guidance on resolving this issue or confirmation if it is a known problem with .NET 8.0 or the Xamarin.Firebase.iOS.Crashlytics library.

Thank you for your assistance.


Original Comments

Feedback Bot on 1/16/2025, 09:39 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@rolfbjarne rolfbjarne added the need-repro Waiting for a test case before the bug can be investigated label Feb 11, 2025
@rolfbjarne rolfbjarne added this to the Future milestone Feb 11, 2025
Copy link
Contributor

Hi @vsfeedback. We have added the "need-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/xamarin/xamarin-macios/blob/main/docs/bug-repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Copy link
Contributor

Hi @vsfeedback. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-repro Waiting for a test case before the bug can be investigated
Projects
None yet
Development

No branches or pull requests

2 participants