What's the right way to use EAS Secrets with a Plist file?

  1. I made an EAS secret for my Google Plist file, GOOGLE_SERVICES_PLIST_DEV. The type of the secret is a file, not a string. I ran “eas secret:create --scope project --name GOOGLE_SERVICES_PLIST_DEV --type file --value ./src/config/development/GoogleService-Info_DEV.plist”, which exactly follows the pattern in the documentation
  2. Inside my app.config.js, I defined: “googleServicesFile: process.env.GOOGLE_SERVICES_PLIST_DEV”
  3. When I build my project locally, it fails. I suspect this is because the secret is a file; if I instead type out the path as a string, the local build succeeds and the app works as expected:
    “googleServicesFile: “./src/config/development/GoogleService-Info_DEV.plist””
  4. If I use the string approach, when I try to build with eas build, that hardcoded path causes the build to fail, since I have the file in my .gitignore.

How should I be accessing the secret in my app.config.js file? Anything else I’m missing here about how to create a secret for a file and have it used for my local “npx expo run:ios” and eas builds?

About my project:

  • Managed workflow
  • eas-cli version 4.1.2
  • So far I’ve read the EAS Secrets documentation, but can’t sort it out, a bit over my head
  1. that is right
  2. sounds good
  3. is GOOGLE_SEVICES_PLIST_DEV set locally? you could use app.config.js and do something like "googleServicesFile": process.env.GOOGLE_SEVICES_PLIST_DEV ?? "./src/config/development/GoogleService-Info_DEV.plist"

you might want to verify that this is being set up properly, also cat $GOOGLE_SERVICES_PLIST_DEV to see the contents. put this inside of a build lifecycle hook.