首页 > 解决方案 > 从颤动初始化火力

问题描述

我需要从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);});

我以博客的文档为指导:

博客多火力基地

标签: firebasefluttergoogle-cloud-firestore

解决方案


推荐阅读