admin管理员组

文章数量:1125062

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" />
    
  4. Added below code on Android MainApplication:

    public override void OnCreate()
    {
       base.OnCreate();
       FirebaseApp.InitializeApp(this);
    }
    
  5. 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)

本文标签: Firebase crashlytics not listing any crashes did from MAUI mobile appStack Overflow