Xamarin.android 默认 FirebaseApp 未在此过程中初始化

Xamarin.android Default FirebaseApp is not initialized in this process(Xamarin.android 默认 FirebaseApp 未在此过程中初始化)
本文介绍了Xamarin.android 默认 FirebaseApp 未在此过程中初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临从 firebase 获取令牌的问题(推送通知)

I face issue with get token from firebase (push notification)

Default FirebaseApp is not initialized in this process com.ready_apps.Nebka.Business. Make sure to call FirebaseApp.initializeApp(Context) first.

即使我调用了 FirebaseApp.InitializeApp(this);在很多地方

even I called FirebaseApp.InitializeApp(this); in many places

MyApplication (that extends Application) ,在我调用 FirebaseInstanceId.Instance?.Token;

MyApplication (that extend Application) , in onCreate of Activity where I call FirebaseInstanceId.Instance?.Token;

推荐答案

此错误已在 Xamarin.Firebase 版本 57.1104.0-beta1 中修复.

This bug has been fixed in Xamarin.Firebase version 57.1104.0-beta1.

此错误似乎出现在较新版本的 Firebase for Xamarin 中.我今天也遇到了这个错误,使用的是最新的稳定版本 42.1021.1.(该错误也出现在最新的 beta 版本中).

This error seems to be present in the newer versions of Firebase for Xamarin. I am also experiencing this error as of today, using the latest stable version 42.1021.1. (The error is also present in the latest beta build).

我发现已针对该问题提交了错误报告此处.

I found that a bug report has been filed for the issue here.

如错误报告中所述,删除 Android 项目中的/obj 和/bin 文件夹,和/或在 Visual Studio 中清理项目应该可以暂时解决问题,直到您更新任何会更改 Resource.Designer 的资源.cs 文件.

As mentioned in the bug report, deleting both the /obj and /bin folders in your Android project, and/or cleaning the project in Visual Studio should fix the problem temporarily until you update any resource that would change the Resource.Designer.cs file.

在永久解决方案可用之前,也可以降级到旧版本的 Firebase 和 Google Play 服务.例如,我在 Firebase 和 Google Play Services 版本 32.961.0 上没有遇到此错误.

Downgrading to an older version of Firebase and Google Play Services is also possible before a permanent solution is available. I did not experience this error on Firebase and Google Play Services version 32.961.0, for example.

这篇关于Xamarin.android 默认 FirebaseApp 未在此过程中初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)