![](/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.