Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
Asked Answered
Q

2

10

I got error and can't complete the build. I search over Stackoverflow and Github. I have tried many ways already but I can't fix. Please help.

(1) Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]

(2) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

When I add google-services.json to app/src/debug and app/src/release (1) will disappear. Then (2) still warning and the build still get FAIL.

Classpath

Build configuration

Compile library

Build result is failed

Quimby answered 13/5, 2018 at 15:58 Comment(0)
H
0

For the Could not find google-services.json warnings, you need to copy your google-services.json into separate folders for each build variant. For the debug build variant, you'll need to copy the google-services.json into [project-folder]/app/src/debug.

The registerResGeneratingTask is deprecated warnings are caused by Gradle plugins you use. I'd recommend upgrading all your Gradle plugins to the latest version, however it's possible those deprecation warnings will still be present and you'll need to wait for the plugin maintainers to fix the deprecation warnings themselves. For instance, as of this writing, the com.google.gms:google-services plugin is still using the deprecated methods.

Homeric answered 18/6, 2018 at 2:46 Comment(1)
Strange thing, that you have to create /src/debug & /src/release and duplicate google-services.json into it. But it's only a notice, and so you don't need to do it, ... only if you wan't to disappear this message, right?Huesman
H
0

My answer might be coming too late but i also ran into this issue after i refactored -> renamed package. So what got things working was that i opened google-services.json and renamed the package name in it and viola. The ideal thing would be to redownload the file from firebase tho.

Hostelry answered 4/4, 2019 at 8:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.