简体   繁体   English

我在哪里放置 Googleservices.json 在 Flutter 应用程序中以解决“google-services.json 丢失”的问题

[英]Where do I place Googleservices.json in Flutter app in order to solve 'google-services.json is missing'

I get this error when i try building the default flutter app after integrating it with Firebase当我在与 Firebase 集成后尝试构建默认的 Flutter 应用程序时出现此错误

I have placed the googleservices.json in the right place.我已将 googleservices.json 放在正确的位置。 Now it says it is searching for it in locations that are not there.现在它说它正在不存在的位置搜索它。 like喜欢

src\debug\nullnull\google- services.json    

this folder does not even exist, i have looked and it is not present.这个文件夹甚至不存在,我看过了,它不存在。

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)

You need to place it under android/app :你需要把它放在android/app

google-service.json 的位置

Also it should be named google-services.json without the space after the dash.此外,它应该命名为google-services.json ,破折号后没有空格。 To rename it right click on it then click Refactor>Rename.要重命名它,请右键单击它,然后单击重构>重命名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM