Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

The Google Services plugin cannot find google-services.json in an Android app

ErrorFile google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

Short answer

The Google Services plugin looks for google-services.json in the app module folder, or in a build-type folder under src. Download the file again from the Firebase console, put it in app/ with its exact name, and make sure it holds a client entry for your package name.

  • Applies to Google Services Gradle plugin 4.x, Android Gradle Plugin 8.x, Firebase Android SDK
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List where the file actually sits. The plugin only reads it from the module root or a src build folder, not from the project root.

    find . -name "google-services*.json" -not -path "*/build/*"
  2. 2Match what you see, then jump to its fix

    1. 1find shows the file in the project root, or as google-services (2).jsonThe file is in the wrong folder or has a changed nameFix
    2. 2The default build works but a flavor or build type failsA build type or flavor needs its own copyFix
    3. 3The file exists but the build still fails or Firebase values are missingThe file has no client for your package nameFix

What does the error look like?

  • File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

Cause 1 of 3

The file is in the wrong folder or has a changed name

1Check

The expected place is the root of the app module, usually app/. A browser download can add a suffix such as (2) to the name.

ls -l app/google-services.json

2Fix

Download the file again from the Firebase console (Project settings, your Android app) and copy it to app/ under the exact name google-services.json.

mv ~/Downloads/google-services.json app/google-services.json

3Verify

Sync Gradle and build the module.

./gradlew :app:assembleDebug

Confirmed by firebase.google.com

Did this fix it?

Cause 2 of 3

A build type or flavor needs its own copy

1Check

From plugin version 2.2.0 you can keep one file per build type, such as app/src/release/ or app/src/dogfood/. With product flavors, nested folders like app/src/dogfood/paid/ are valid too.

find app/src -name google-services.json

2Fix

Put a file in the folder for each build type or flavor that builds, or keep one copy in app/ that covers them all.

app/google-services.json
# or one per build type
app/src/release/google-services.json

3Verify

Build each variant that failed.

./gradlew :app:assembleRelease

Confirmed by firebase.google.com

Did this fix it?

Cause 3 of 3

The file has no client for your package name

1Check

The plugin only uses the client entry that matches your app's package name. Compare the name in the file with the application ID in the module build file. The name is case-sensitive and cannot be changed after registering the app.

grep -n "package_name" app/google-services.json
grep -n "applicationId" app/build.gradle app/build.gradle.kts 2>/dev/null

2Fix

Register an Android app in Firebase with the exact application ID you build, then download the new file. If you build several IDs, add each one to the Firebase project.

# Firebase console: Project settings > Your apps > Add app

3Verify

Rebuild; the plugin should accept the file.

./gradlew :app:assembleDebug

Confirmed by firebase.google.com

Did this fix it?

How do I stop it coming back?

  • Commit the file (or fetch it in CI) so a fresh clone can build.
  • Check the file name after every download; remove suffixes like (2).
  • Register each build type's application ID in Firebase before you add it.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Expo Android push fails because google-services.json is missing

"google-services.json" is missing for firebase

Android push in Expo goes through Firebase Cloud Messaging, which needs two separate things: the google-services.json file inside the app, pointed to by android.googleServicesFile, and a service account key uploaded to Expo for sending.

2 causes, each with a fix

Mobile apps

Flutter Android: Failed to load FirebaseOptions from resource

Failed to load FirebaseOptions from resource. Check that you have defined values.xml correctly.

On Android, Firebase reads its settings from a values.xml file that the Google services Gradle plugin builds from google-services.json.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.