If you are sure that file is checked in into repo then it should work and maybe warning is triggered incorrectly.
what version of cli are you using?
can you share exact value in app.json(how the path is specified)
how is your directory structure looks like (where is eas.json and googole services json relative to root of the repository)
I know it is not a good practice but I would like to keep it in my repo
I would not worry about that, anyone can extract that file from apk or after installing an app from play store either way so, it’s not really a secret value (it still shouldn’t be in public repo, but it’s fine in private one)
At first, i had both files (GoogleService-Info.plist and google-services.json) in the root of my project, also eas.json. And previous version of expo-cli and eas-cli. Now I have both files in a separated folder, and updated the versions. This is the configuration:
I am having the exact same warning. I am on latest version of Expo SDK and EAS CLI. And also both my eas.json and google-services.json are in the same root directory of the project. But still I am getting this warning. Please help! Because I don’t want to make a new build until this is sorted out because if its true then my notifications would be disabled isnt it?
Exactly same error. More … there was no error in 17.06.2021 - last eas build before today. Today I tried eas build and received eas cli update requirement message. After update I’ve received yellow message:
File specified via “android.googleServicesFile” field in your app.json is not checked in to your repository and won’t be uploaded to the builder.
Use EAS Secret to pass all values that you don’t want to include in your version control. Learn more: Environment variables and secrets in EAS Build - Expo Documentation
If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting GOOGLE_SERVICES_FILE in your build profile in eas.json to any non-falsy value.
@geperson can you explain what is the problem? This warning should show up in some cases, without knowing your situation I can’t tell if it’s a correct behavior. I think warning message is pretty descriptive, is there something incorrect there?
btw @idrlmartian@jorexe warning should not show up anymore for you in latest eas-cli release
@wkozyra Looks like it’s only message and wrong message, because google auth in Android standalone app is works correctly. It should not work without google-services.json. So, file exists, they been uploaded but message is wrong. I have no another explanation.
ecause google auth in Android standalone app is works correctly. It should not work without google-services.json. So, file exists, they been uploaded but message is wrong
you are making a lot of assumptions there
file can be added to on builder in other ways e.g. EAS secrets
file can be ignored but still present in the git repo
It’s possible that there is a bug there, but without any info, I can’t reproduce it and I’m not even sure at this point whether the behavior you are referring to is incorrect
Just found this thread after having the exact same warning :
File specified via "android.googleServicesFile" field in your app.json is not checked in to your repository and won't be uploaded to the builder.
Use EAS Secret to pass all values that you don't want to include in your version control. Learn more: https://docs.expo.dev/build-reference/variables/#using-secrets-in-environment-variables
If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting your build profile's env.GOOGLE_SERVICES_FILE in eas.json to any non-empty string.
We are on SDK 43 with EAS CLI 0.38.
Our app works perfectly since w’re using EAS Secrets + hooks to decode a base 64 env variable that contains our google-services.json.
However, we need this file in development environment to run the app so we have it on our machines even if it’s in gitignore
I don’t think this warning should exist in this use case but maybe I’m wrong
Having the same issue. Seems like the team don’t really get the point of this issue or I don’t.
But from what I think and I know, we are all (maybe just me) looking for a way to make available the google-services.json file for the eas build without adding to git.
You say do it with eas secrets, am like how? because I will have to convert the google-services.json file to a javascript file right?
But then will it still work?
@yonitou mentioned “…eas secrets + hooks to decode a 64 base env variable…”, you seem to have found a solution to this, but I honestly don’t understand it, can you provide the hook(s) you used, or maybe just share how you did it, because am kinda new to this eas and I don’t know how to go about any of these.
Though I am having an issue with the eas-build-pre-install, I believe am doing something wrong, if you can help me sort it out here, this is the error I get
Script 'eas-build-pre-install' is present in package.json, running it...
> @ eas-build-pre-install /root/workingdir/build
> echo $google_services | base64 -d > google-services.json
[stderr] base64: invalid input
[stderr] npm
[stderr] ERR! code ELIFECYCLE
[stderr] npm ERR! errno 1
[stderr] npm ERR!
[stderr] @ eas-build-pre-install: `echo $google_services | base64 -d > google-services.json`
[stderr] npm ERR! Exit status 1
[stderr] npm ERR!
[stderr] npm ERR! Failed at the @ eas-build-pre-install script.
[stderr] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[stderr] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[stderr] npm ERR! A complete log of this run can be found in:
[stderr] npm ERR! /root/.npm/_logs/2022-02-03T02_04_00_962Z-debug.log
Steps to reproduce
I encoded my google-services.json into a base64 and saved it in eas secrets as google_services, meanwhile, I have completely cleared my google-services.json (now an empty file).
This is what I have set up as my eas-build-pre-install:
the hook is correct, you must have encoded your google services json incorrectly
to encode it run cat path/to/google-services.json | base64 and if you are on linux cat path/to/google-services.json | base64 -w 0
If you see % at the end of the output this is not part of the base64 encoded string(this is just how terminals display commands that do not send newlines at the end
Thanks. You are correct, the base64 was invalid.
Though I should mention cat path/to/google-services.json | base64 didn’t work on my windows powershell, but then I got this [convert]::ToBase64String((Get-Content -path "path/to/google-services.json" -Encoding byte) from windows docs and it worked fine.
Just in case any one faces the same error as myself