EAS local build and eas-build-pre-install

Hi! trying to local build my android app I get

[RUN_GRADLEW] Parsing json file: /tmp/martinb/eas-build-local-nodejs/5056902b-eef2-446c-a3b0-43485234b3be/build/android/app/google-services.json
[RUN_GRADLEW] > Task :app:checkDebugAarMetadata
[RUN_GRADLEW] 45 actionable tasks: 45 executed
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:processDebugGoogleServices'.
[RUN_GRADLEW] > Malformed root json

I think the issue is this line in the package.json:

“eas-build-pre-install”: “echo $GOOGLE_SERVICES_JSON | base64 --decode > ./google-services.json”

This of course is needed for expo builds but as I’m running local build, the env var $GOOGLE_SERVICES_JSON is not defined so the file /tmp/martinb/eas-build-local-nodejs/XXXXXXX/build/android/app/google-services.json gets empty

Is there a way to tell EAS that if I run local build then ingore somehow eas-build-pre-install?


You can check EAS_BUILD_RUNNER env or CI and if it’s local build exit early from the script

Thanks! FInally i read this

  • EAS Secrets are not supported (set them in your environment locally instead).

So I created the env variable in my .bashrc file