在 Xamarin Android 中使用 Firebase 获取异常 [英] Getting Exception Using Firebase in Xamarin Android

查看:21
本文介绍了在 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.

推荐答案

检查 FirebaseInitProvider 标签的 logcat 输出,如果你得到:

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

[FirebaseInitProvider] FirebaseApp 初始化不成功

然后主要检查两件事情:

Then the two major things to check:

  • 确保为您的 google-services.json 分配了 GoogleServicesJson<的构建操作/code>

  • 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 将导致以下 logcat:

A successful FirebaseApp registration will result in the following logcat:

FirebaseInitProvider:FirebaseApp 初始化成功

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆