【问题标题】:Flutter google-services.json file is missing errorFlutter google-services.json 文件丢失错误
【发布时间】:2022-01-07 13:33:46
【问题描述】:

我已将 google-services.json 文件放在以下路径中

但我得到了错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
   Searched Location: 
  F:\downloads\food_delivery_app-master\food_delivery_app-master\android\app\src\debug\google-services.json
  F:\downloads\food_delivery_app-master\food_delivery_app-master\android\app\src\google-services.json
  F:\downloads\food_delivery_app-master\food_delivery_app-master\android\app\google-services.json


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 25s
Exception: Gradle task assembleDebug failed with exit code 1

我搜索了所有发布的解决方案。但没有一个奏效。我该如何解决这个问题?请帮助已经有一段时间了。谢谢。

【问题讨论】:

  • 试试flutter clean,同时检查this
  • 是我,还是文件名中有多余的空格?是google-services .json,但应该是google-services.json
  • @DarjaOrlova 我也看到了。我检查了 VS Code,似乎是这种情况。
  • 你能显示你初始化 Firebase 的地方吗?并尝试清除 IDE for android 的缓存 - 使缓存无效并重新启动。
  • 我在android/app级别的gradle文件中添加了apply plugin: 'com.google.gms.google-services'

标签: firebase flutter


【解决方案1】:

您的 Google 服务文件似乎命名错误!

如果确实命名不正确,请重命名:

google-services .json

google-services.json

有一个额外的空间!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-04
    • 1970-01-01
    • 2019-11-30
    • 1970-01-01
    • 1970-01-01
    • 2018-05-18
    • 2021-09-11
    相关资源
    最近更新 更多