35

I get this error when i try building the default flutter app after integrating it with Firebase

I have placed the googleservices.json in the right place. 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)

2 Answers 2

96

You need to place it under android/app:

location of google-service.json

Also it should be named google-services.json without the space after the dash. To rename it right click on it then click Refactor>Rename.

4
  • 1
    hah I feel so stupid. I was placing it at the wrong directory. Thank you for the illustration and answer
    – Taio
    Aug 10, 2018 at 11:08
  • @PeterHaddad one can also put them into src/main & src/debug source-sets. Aug 10, 2018 at 16:13
  • 1
    The image shows it in the android/app/src directory. However it is indeed supposed to be in the android/app directory!
    – guivho
    Mar 23, 2019 at 18:21
  • 11
    @guivho actually not. If you look carefully, you will notice src directory is not expanded on the picture.
    – kokoko
    May 11, 2020 at 18:14
0

Fixed by adding google-services.json into App_Resources/src directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.