EAS Build Fails: "google-services.json is missing" after trying all configurations
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 236
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 91
Description
### Build/Submit details page URL
https://expo.dev/accounts/andrewaiss/projects/nestr-app/builds/f0768686-dfdf-443a-baab-e85b49e1a7cf
### Summary
Hello, I'm facing a persistent issue with my Android build and I'm completely stuck. I would appreciate any help.
The build consistently fails with the error `"google-services.json" is missing`, even after following the official documentation for file secrets.
* **Project:** `@andrewaiss/nestr-app`
* **Last Failed Build ID:** `f0768686-dfdf-443a-baab-e85b49e1a7cf`
* **`app.config.js` snippet:**
```javascript
"android": {
"package": "com.nestr.app",
"googleServicesFile": "./google-services.json"
},
```
* **`eas.json`:** Is clean, with no `hooks` or `env` variables related to this.
**What I've already tried:**
I have already created an EAS Secret of type **`file`** with the correct name **`GOOGLE_SERVICES_FILE`**, scoped to all environments (`development`, `preview`, `production`). The secret was created successfully.
Despite the secret existing with the correct name and type, the build process fails at the prebuild step, unable to find the `google-services.json` file on the server. The logs show the error occurs when trying to copy the file, which means the secret is not being substituted as expected.
Could someone from the team please inspect the server-side logs for the build ID provided to see why the secret is not being applied? I suspect there might be a project-specific state or configuration issue on the EAS platform that I can't see.
Thank you very much.
### Managed or bare?
Bare
### Environment
expo-env-info 2.0.7 environment info:
System:
OS: Windows 11 10.0.26100
Binaries:
Node: 20.19.5 - C:\nvm4w\nodejs\node.EXE
Yarn: 1.22.22 - C:\nvm4w\nodejs\yarn.CMD
npm: 10.8.2 - C:\nvm4w\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 33, 34, 35
Build Tools: 34.0.0, 35.0.1, 36.0.0
System Images: android-33 | Google APIs Intel x86_64 Atom, android-33 | Google Play Intel x86_64 Atom, android-34 | Google Play Intel x86_64 Atom, android-36 | Google APIs Intel x86_64 Atom, android-36 | Google Play Intel x86_64 Atom, android-36 | Pre-Release 16 KB Page Size Google Play Intel x86_64 Atom
npmPackages:
expo: ~51.0.14 => 51.0.39
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.74.5 => 0.74.5
react-native-web: ~0.19.13 => 0.19.13
Expo Workflow: bare
env: load .env
env: export EXPO_PUBLIC_GOOGLE_MAPS_API_KEY
16/16 checks passed. No issues detected!
### Error output
✖ Build failed
🤖 Android build failed:
"google-services.json" is missing, make sure that the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS environment variables to provide EAS Build with the file.
Learn more: https://docs.expo.dev/eas/environment-variables/#file-environment-variables
### Reproducible demo or steps to reproduce from a blank project
Initialize a new project in the Bare Workflow: npx create-expo-app -t bare-minimum
Set up a Firebase project for Android and download the google-services.json file.
In app.config.js, add the googleServicesFile key inside the android section, pointing to the local file: "googleServicesFile": "./google-services.json"
Add the google-services.json file to the project root and also add its path to the .gitignore file to prevent it from being committed.
Set up EAS for the project with eas init.
Create an EAS Secret of type file with the name GOOGLE_SERVICES_FILE, uploading the content of the local google-services.json file. Assign it to all environments.
Run an Android build: eas build -p android.
Observe that the build fails during the Prebuild step with the error that google-services.json is missing, even though the GOOGLE_SERVICES_FILE secret is correctly configured.
Contributor guide
Assessment
This issue has not been assessed yet.