firebase - 从颤动初始化火力
问题描述
我需要从flutter main初始化Firebase,没有google-service-json,按照文档我收到以下错误
PlatformException(firebase_core, java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process nameproject.firebase
我做初始化的方式如下
await Firebase.initializeApp(
name: 'xxxxxx', options: FirebaseOptions(
appId: 'xxxxxx',
messagingSenderId: 'xxxxx',
apiKey: 'xxxxx',
projectId: 'xxxxxx',
databaseURL: 'xxxxx'))
.then((value) {
print('goods');}).catchError((e) {
print('error');
print(e);});
我以博客的文档为指导:
解决方案
推荐阅读
- json - Aeson 使用先前解析的默认值解析 JSON
- python - 在 python 中实现新的路由协议
- go - 如何在我的主包中导入本地文件
- javascript - jQuery Datepicker setDate - 在 Datepicker 2 中查找下一个工作日
- php - 自定义中间件无法阻止被禁止的用户
- javascript - React js 不认识我的 map 方法
- javascript - 使用没有类组件的构造函数(道具)
- keras - 在 SageMaker 管理的 AWS ml.p2.xlarge 实例上,Keras/Tensorflow 未检测到 GPU
- vue.js - 变量在父级中更改但在子级 VueJ 中未更改
- javascript - 我不能在 node.js 中使用 router.post 方法