GoogleServicesFile is not checked in to your repository

Hi, I’m having issues uploading the google services file. I’m having this 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.”

But, I have the file in my repository indeed.

I know it is not a good practice but I would like to keep it in my repo

Thank you!

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)

Thank you very much for your response.

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:

ios: {
      buildNumber: '38',
      bundleIdentifier: 'org.reactjs.native.example.drinkdeliveryclient',
      config: {
        googleSignIn: {
          reservedClientId:
            '...',
        },
      },
      googleServicesFile: './external/GoogleService-Info.plist' (previous './GoogleService-Info.plist'),
      supportsTablet: true,
    },
    android: {
      versionCode: 38,
      adaptiveIcon: {
        foregroundImage: './assets/adaptive-icon.png',
        backgroundColor: '#103049',
      },
      googleServicesFile: './external/google-services.json' (previous './google-services.json'),
      icon: './assets/icon.png',
      package: 'com.drinkdeliveryclient',
      permissions: [
        'ACCESS_COARSE_LOCATION',
        'ACCESS_FINE_LOCATION',
        'ACCESS_NETWORK_STATE',
      ],
    },

eas-cli: eas-cli/0.25.0 win32-x64 node-v14.16.1
expo-cli: 4.11.0

Now i have:

$root/app.config.ts
$root/external/google-services.json
$root/external/GoogleService-Info.plist

Thanks!

Hey Team,

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?

This is under the android field in my app.json

“googleServicesFile”: “./google-services.json”,

        "useNextNotificationsApi": true,

        "adaptiveIcon": {

            "foregroundImage": "./assets/icons/idrl/adaptive-icon.png",

            "backgroundColor": "#ffffff"

        }

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?

no, if that is the case build should fail, and even if it didn’t this will only affect that apk/aab/ipa, not the apps in production

@idrlmartian are you also on windows?

Also, I’m receiving the following error when attempting to log in with google

Custom scheme URIs are not allowed for 'WEB' client type

Not sure if it is related

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.

eas-cli/0.27.1 win32-x64 node-v12.14.0
expo-cli: 4.11.0

Thanks for help

@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

1 Like

@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

1 Like

Hi !

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 :slight_smile:

Have a nice evening,

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.

Thanks

see this EAS Build: how to include non-Git (private) files, eg google-services.json - #2 by wkozyra

1 Like

Thanks for this, I now understand how it works.

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:

"eas-build-pre-install": "echo $google_services | base64 -d > google-services.json"

Thanks.

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

1 Like

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