在此过程中未初始化默认FirebaseApp.确保首先调用FirebaseApp.initializeApp(Context)

Use*_*com 9 firebase xamarin xamarin.forms

在此过程中未初始化默认FirebaseApp.确保首先调用FirebaseApp.initializeApp(Context).

我尝试了很多东西,但我无法在设备中获取通知.

我也试过下面的事情.

在"属性"窗格中,在"解决方案资源管理器"窗口中设置"构建操作"选择google-services.json.

在"属性"窗格中,将"构建操作"设置为"GoogleServicesJson"(如果未显示GoogleServicesJson构建操作,请保存并关闭解决方案,然后重新打开它):到GoogleServicesJson

通知之前有效,但在我将xamarin表单更新到2.5.0.280555和Xamarin.Firebase.Messaging.42.1021.1之后,它停止了工作.

Amm*_*ari 25

对我来说,没有任何解决方案可以在任何地方使用.只有这个有效.只需将我的谷歌服务从4.1.0降级到4.0.0

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0-alpha08'
    classpath 'com.google.gms:google-services:4.0.0'
    /*classpath 'com.google.gms:google-services:4.1.0' <-- this was the problem */
}
Run Code Online (Sandbox Code Playgroud)

因此,如果您更新了Google服务,只需尝试降级或更改为旧版本.希望能帮助到你

  • 在我的情况下,我不得不升级到com.google.gms:google-services:4.2.0 (3认同)

EvZ*_*EvZ 12

确保:

  1. 包名称AndroidManifest.xml与中的一个相同google-services.json
  2. google-services.json 构建操作设置为 GoogleServicesJson
  3. 在第2步之后,重新启动IDE并清理并重建
  4. FirebaseApp.InitializeApp(Application.Context);MainActivity.OnCreate之前明确地打电话LoadApplication(..)


Dan*_*anu 6

将插件添加到build.gradle(应用程序级别)

//在底部添加此内容

apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)