android - 为了解决 'google-services.json is missing',我在 Flutter 应用程序中应该在哪里放置 Google Services.json

标签 android firebase flutter dart

当我在与 Firebase 集成后尝试构建默认 Flutter 应用程序时遇到此错误

我已将 googleservices.json 放置在正确的位置。现在它说它正在不存在的位置搜索它。喜欢

src\debug\nullnull\google- services.json    

这个文件夹甚至不存在,我看过了,它不存在。

Launching lib\main.dart on Phone in debug mode...
Configuration 'compile' in project ':app' is deprecated. Use 
'implementation' instead.
 registerResGeneratingTask is deprecated, use 
 registerGeneratedFolders(FileCollection)
 registerResGeneratingTask is deprecated, use 
 registerGeneratedFolders(FileCollection)
 registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)

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: 
C:\Users\rober\Documents\VS\APPNAME\android\app\src\nullnull\debug\google- 
services.json
C:\Users\rober\Documents\VS\APPNAME\android\app\src\debug\nullnull\google- 
services.json
C:\Users\rober\Documents\VS\APPNAME\android\app\src\nullnull\google- 
services.json
C:\Users\rober\Documents\VS\APPNAME\android\app\src\debug\google- 
services.json
C:\Users\rober\Documents\VS\APPNAME\android\app\src\nullnullDebug\google- 
services.json
C:\Users\rober\Documents\VS\APPNAME\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.

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

BUILD FAILED in 8s
Gradle build failed: 1
Exited (sigterm)

最佳答案

你需要把它放在android/app下:

location of google-service.json

还应将其命名为 google-services.json,破折号后不带空格。要重命名它,请右键单击它,然后单击 Refactor>Rename。

关于android - 为了解决 'google-services.json is missing',我在 Flutter 应用程序中应该在哪里放置 Google Services.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51783588/

相关文章:

iOS:如何跟踪firebase动态链接

flutter - 如何在初始小部件构建后使 AnimatedContainer 更改高度,而不是在单击按钮时更改高度

java - 如何从android中的字符串文件填充微调器

java - 类型不匹配 : cannot convert from String to List<Cmd>

android - 如何为 android 和 iphone 创建自己的 Magento 移动应用程序

android - 如何使用 react-native-firebase 从 Firebase 动态链接接收查询参数?

java - androidx BottomNavigationView 未显示

node.js - Firebase 函数 : How to maintain 'app-global' API client?

firebase - 如何使Flutter Firebase时间戳仅显示日期

flutter - Flutter如何删除GridView的顶部空间