eas build with gitignored google-services.json file.
See original GitHub issueHello, Great tool! enjoying using it a lot.
At the moment I am having to commit my google-services.json & GoogleService-Info.plist files in order to allow the cloud-build to work properly but this seems a bit of a security risk?
Ideally, I’d have these files reference in my .gitignore
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] [17:16:45] Cannot copy google-services.json from /usr/local/lib/node_modules/@expo/eas-build-worker/workingdir/build/google-services-staging.json to /usr/local/lib/node_modules/@expo/eas-build-worker/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] [17:16:45] Error: Cannot copy google-services.json from /usr/local/lib/node_modules/@expo/eas-build-worker/workingdir/build/google-services-staging.json to /usr/local/lib/node_modules/@expo/eas-build-worker/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.
[stderr] at setGoogleServicesFile (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/android/GoogleServices.ts:79:11)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at runMicrotasks (<anonymous>)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at processTicksAndRejections (internal/process/task_queues.js:93:5)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at /usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/android/GoogleServices.ts:53:7
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at action (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/plugins/core-plugins.ts:118:23)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at action (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/plugins/compiler-plugins.ts:282:23)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at evalModsAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/plugins/mod-compiler.ts:75:25)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at compileModsAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/@expo/config-plugins/src/plugins/mod-compiler.ts:17:10)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at configureManagedProjectAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/expo-cli/src/commands/apply/configureProjectAsync.ts:115:12)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at prebuildAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/expo-cli/src/commands/eject/Eject.ts:146:25)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at Object.ejectAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/expo-cli/src/commands/eject/Eject.ts:78:19)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at actionAsync (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/expo-cli/src/commands/eject.ts:46:5)
Sat, 06 Feb 2021 17:16:45 GMT
[stderr] at Command.<anonymous> (/usr/local/lib/node_modules/@expo/eas-build-worker/node_modules/expo-cli/src/exp.ts:346:7)
Sat, 06 Feb 2021 17:16:45 GMT
Build failed: node exited with non-zero code: 1
Is there any workaround to this scenario/issue?
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:27 (8 by maintainers)
Top Results From Across the Web
Troubleshooting build errors and crashes
A reference for troubleshooting build errors and crashes when using EAS Build.
Read more >Should I add the google-services.json (from Firebase) to ...
My question is, should this .json file be added to a public (open source) repo. Is it something that should be secret, like...
Read more >eas-cli
If you want to enforce the eas-cli version for your project, use the "cli.version" field in eas.json. Installing eas-cli to your project ...
Read more >What to push to github? : r/androiddev
It's as simple as adding google-services.json on a newline in your .gitignore file. To also delete this file from your repository there are ......
Read more >Configure Firebase project for Continuous Integration builds
Because you've added google-services.json to .gitignore , it will not exist in your Git remote repo. When new CI build triggered, it will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi guys,
You don’t need to commit the gitignored files to the repo.
Here’s a workaround (assuming you want your build to have access to google-service.json):
$ base64 google-services.jsoneas secret:create(e.g.GOOGLE_SERVICES_BASE64)"eas-build-pre-install": "echo $GOOGLE_SERVICES_BASE64 | base64 --decode > /path/to/google-services.json"I have a related case - I use tailwind-rn for styles, so I constantly have unexpected changes to
tailwind.cssandtailwind.jsonin my commits, which results in merge conflicts with other PRs. Ignoring them and generating at build time works, but then eas also ignores them. So I started generating.easignore, too.cc/ @diegoconcha as you mentioned having to keep two files up to date.
tl;dr: generate your
.easignorefrom your.gitignoreat build time.Which (I think) is the only time you need it.
.gitignore:
generate-easignore.js
package.json
This will output a
.easignorethat includes everything in.gitignoreexcept theEASINCLUDE!line and everything below it. Use whatever you want for the separator string, I chose something that seemed programmatic so no one touches it unwittingly. Run it before you runeas build, probably in an npm script.