Android: Error not copying google-services.json to Z:/ when builoding with RunUAT

Hi,

We are able to build our game with a plugin with google-services.json using the editor, but the build fails when building using command line with RunUAT.bat.

Errror:

> Task :app:processDebugGoogleServices FAILED
5 actionable tasks: 5 executed
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 locations: Z:\AFSProject\app\src\debug\google-services.json, Z:\AFSProject\app\src\debug\google-services.json, Z:\AFSProject\app\src\google-services.json, Z:\AFSProject\app\src\debug\google-services.json, Z:\AFSProject\app\src\Debug\google-services.json, Z:\AFSProject\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 9s


> Task :app:ueAFSProjectAssembleDebug FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:ueAFSProjectAssembleDebug'.
> Process 'command 'cmd'' finished with non-zero exit value 1
92 actionable tasks: 92 executed

How could we fix this error?

Best Regards,

Xavi

Steps to Reproduce

  • Create a project with a google-services.json file at <your_plugin>/Android
  • Add this code to your APL.xml:
<gradleCopies>
    <copyFile src="$S(PluginDir)/Android/google-services.json" dst="$S(BuildDir)/gradle/app/google-services.json" force="false"/>
</gradleCopies>

  • Run the next command:
Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project=%cd%"<your_project_path>.uproject" -platform=Android -clientconfig=Shipping -serverconfig=Shipping -target=SDKSampleUE -build -cook -stage -deploy -run

Hi Xavier,

Are you building the same Shipping configuration from editor and command line? Try adding:

<copyFile src="$S(PluginDir)/Android/google-services.json" dst="$S(BuildDir)/gradle/AFSProject/app/google-services.json" force="false"/> to the APL.xml file and let us know if that resolves.

Best regards.

The issue was fixed adding the copyFile suggested line to <gradleCopies>.

Thank you.

Glad to hear that worked. Thank you for letting us know.

Best regards.