Could not find google-services.json while looking in [src/nullnull/release, src/release

Viewed 923

I'm trying to build a stand alone apk version of my react native app I built with expo but when I run expo build:android I keep getting this error

Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]

I have the google-services.json file in the root directory of my app.

I have checked posts from stack overflow, github, and even their forums still nothing useful.

Most of the things I saw had to do with the app.json file but none was specific. The same goes for GitHub

Expo Sdk: 40.0.0

Template Used: Blank

React-Native Version: 0.63.4

app.json file image

1 Answers

There are no updates because this is not an expo issue. However, over the pas 2 months, we've set up FCM for 12 projects, and have failed a few times.

In order to set-up FCM, we follow these steps

  1. created a project on http://cloud.google.com/ link a billing account

enable whichever apis we need (e.g. maps)

  1. create a new project on https://firebase.google.com/ select the cloud.google.com project.

  2. add a new android application

  3. enter the correct package name, leave SHA empty

  4. download google-services.json and place in root of project

  5. go to server tab and copy key () add the configuration to app.json

make sure you have the same package name in app.json make at least one android build expo fetch:android:hashes; take the shas, put them in the field in step 7.

expo push:android:upload --api-key but use the from step 9.

Now everything works. Note that on step 12, it should not fail. If done everything correctly, it will build just fine.

After this we continue by adding iOS, Web app, restrict the keys in google cloud console, upload a bundle to Play Store and copy the signing key shas to step 7 as well.

Common issues we have encountered:

  • incorrect package name will act as if google-services.json isn't there

  • didn't place google-service.json in the root

  • didn't add package name to app.json

  • didn't add google services file path to app.json

  • used incorrect format inside app.json (because iOS and Android also take googlemaps keys and the format for configuration is not the same)

Related