问题描述
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 ofGoogleServicesJson
检查您的应用程序包名称是否与您在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取得例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!