[英]FirebaseCloudMessaging : PlatformException (PlatformException(null-error, Host platform returned null value for non-null return value., null, null))
[英]Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)
我只是忘记在android/app/build.gradle
中添加 Google 服务插件:
apply plugin: 'com.google.gms.google-services'
确保您的 pubspec.yaml 中有 firebase_core 然后,只需在 main 中使用以下内容:
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
跑
flutter 清洁
和
flutter 酒吧得到
在您的终端中。
如果仍然失败,请按照 firebase 文档逐步执行 go。 它应该工作。 https://firebase.google.com/docs/flutter/setup?platform=android
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.