java.lang.IllegalStateException:非空字段“apiKey”在flutter中为空

问题描述 投票:0回答:1

`将我的项目连接到 firebase 时遇到问题。

i have initialized firbase in the main.dart and added the latest dependences for firebase yet still getting error.

运行应用程序时收到的错误消息

调试服务监听 ws://127.0.0.1:61148/B_vHAEnC2Q0=/ws 正在将文件同步到 IA 模拟器上的设备 AOSP... E/flutter(8614):[错误:flutter/runtime/dart_vm_initializer.cc(41)]未处理的异常:PlatformException(java.util.concurrent.ExecutionException:java.lang.IllegalStateException:非空字段“apiKey”为空。,ExecutionException ,原因:java.lang.IllegalStateException:非空字段“apiKey”为空。,堆栈跟踪:java.util.concurrent.ExecutionException:java.lang.IllegalStateException:非空字段“apiKey”为空。 E /扑(8614):在com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@18.1.0:5)

`Future main () async {
     WidgetsFlutterBinding.ensureInitialized();

  
       await Firebase.initializeApp(
      // name: 'myApp',

           

选项:const FirebaseOptions( apiKey: "AIzaSyADtdL5o92bi0vA0gjVk7n0T-yWIv6tYAc", appId: "1:789598705260:android:68eae709b4390260d62a49", 消息发件人 ID:“789598705260”,

` 项目 ID:“myApp-d4b86”,

       ) `

 

I was expecting the app to initialized and connect to firebase, but got an error`
flutter firebase firebase-authentication api-key
1个回答
0
投票

https://www.youtube.com/watch?v=w0QHkvJlfZM

fijate si te Sirve esto, esto me Sirvió

© www.soinside.com 2019 - 2024. All rights reserved.