Firebase crashlytics not listing any crashes did from MAUI mobile app

Sakshi Poojary 95 Reputation points
2025-01-14T10:03:38.6233333+00:00

I did below steps to Set Up Firebase Crashlytics in my .NET MAUI app.

  1. Created a new project in firebase console and added android and ios project. Downloaded the google-services.json file and GoogleService-Info.plist file and added it on the project. (I have already did this for push notification implementation)
  2. Added Plugin.Firebase.Crashlytics package.
  3. Added below meta-data on AndroidManifest file.
<meta-data android:name="firebase_crashlytics_collection_enabled" android:value="true" />
  1. Added below code on Android MainApplication:
public override void OnCreate()
{
   base.OnCreate();
   FirebaseApp.InitializeApp(this);
}
  1. Added below code on AppDelegate
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    Firebase.Core.App.Configure();
    return base.FinishedLaunching(app, options);
}

I did a test crash like below when click on a button:

private void TestSampleCrash(object sender, EventArgs e)
{
    throw new Exception("Test crash for Firebase Crashlytics");
}

But it is not showing on firebase crashlytics console. Am I missing anything in this integration?

Current crash issue in FCM Console:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.widget.Toast.<init>(Toast.java:118) at android.widget.Toast.makeText(Toast.java:286) at android.widget.Toast.makeText(Toast.java:276) at crc6488302ad6e9e4df1a.MauiApplication.n_onCreate(MauiApplication.java) at crc6488302ad6e9e4df1a.MauiApplication.onCreate(MauiApplication.java:28) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1124) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5969) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:192) at android.app.ActivityThread.main(ActivityThread.java:6759) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,842 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 47,356 Reputation points Microsoft Vendor
    2025-01-15T01:56:51.4433333+00:00

    Hello,

    Plugin.Firebase.Crashlytics is a third-party plugin and is not officially supported by Microsoft. For the configuration of this plugin on the Maui platform, you can refer to the following documentation and code sample provided by the plugin to check if there are any missing steps.

    Basic setup:

    1. Create a Firebase project in the Firebase Console, if you don't already have one. If you already have an existing Google project associated with your mobile app, click Import Google Project. Otherwise, click Create New Project.
    2. Click Add Firebase to your [iOS|Android] app and follow the setup steps. If you're importing an existing Google project, this may happen automatically and you can just download the config file.
    3. Add [GoogleService-Info.plist|google-services.json] file to your app project.
    4. Set [GoogleService-Info.plist|google-services.json] build action behaviour to [Bundle Resource|GoogleServicesJson] by Right clicking/Build Action.
    5. (iOS only) Check the Readme at AdamEssenmacher/GoogleApisForiOSComponents for additional setup steps that may be required.

    Best Regards,

    Alec Liu.


    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.