我面临从 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 未在此过程中初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!