![](/img/trans.png)
[英]Caused by: org.gradle.api.GradleException: File google-services.json is missing. The Google Services Plugin cannot function without it
[英]Flutter : File google-services.json is missing. The Google Services Plugin cannot function without it
在连接我的 flutter 应用程序后,我已经从我的 firebase 中附加了 google-services.json 文件并执行了所有步骤,但我仍然收到此错误。 我在网上寻找其他答案,但没有一个有帮助。 I tried opening the app in chrome but then I recieved this error "Error: Assertion failed: D:\…\src\firebase_core_web.dart:273 options.= null "FirebaseOptions cannot be null when creating the default app."
这些有联系吗? 我能做些什么来解决这些问题?
一旦您在 flutter 代码中初始化 firebase ,您的 firebase_core 版本似乎足以通过 FirebaseOptions 。
添加这个。
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
// Replace with actual values
options: FirebaseOptions(
apiKey: "XXX",
appId: "XXX",
messagingSenderId: "XXX",
projectId: "XXX",
),
);
runApp(MyApp());
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.