本文介绍了在Xamarin Android中使用Firebase取得例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java.Lang.IllegalStateException: Default FirebaseApp is not initialized in this process TestChartApp.TestChartApp. Make sure to call FirebaseApp.initializeApp(Context) first.

这是我正在使用的代码

FirebaseApp.InitializeApp(this);

try
    {
        throw new NotImplementedException();
    }
    catch (System.Exception ex)
    {   
    FirebaseCrash.Report(ex);
    }

我是刚实现Firebase崩溃报告的人,我正在尝试实现崩溃报告,但它引发了错误.请帮我如何解决这个问题.

I am new to implement firebase crash reporting i am trying to implement crash report but it is throwing an error. please help me how can i solve that.

推荐答案

如果得到以下内容,请查看logcat输出的FirebaseInitProvider标记:

Review your logcat output for FirebaseInitProvider tags, if you are getting:

[FirebaseInitProvider] FirebaseApp initialization unsuccessful

[FirebaseInitProvider] FirebaseApp initialization unsuccessful

接下来要检查的两件事:

Then the two major things to check:

  • 确保为您的 google-services.json 分配了 GoogleServicesJson

  • Make sure that your google-services.json is assigned a build action of GoogleServicesJson

检查您的应用程序包名称是否与您在Google Dev中分配的名称相匹配.控制台

Check that your application package name matches the one that you assigned in the Google Dev. Console

FirebaseApp成功注册将导致以下日志:

A successful FirebaseApp registration will result in the following logcat:

FirebaseInitProvider: FirebaseApp initialization successful

FirebaseInitProvider: FirebaseApp initialization successful

这篇关于在Xamarin Android中使用Firebase取得例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 01:45