An Android build may fail with the following message:
No matching client found for package name 'com.example.app'
The same error can appear while Gradle builds the Android part of a Flutter or React Native project.
It means that the app’s final applicationId does not match any package_name entry in the active google-services.json file.
How the error occurs
The Google Services Gradle Plugin reads each client entry in google-services.json and searches for one whose package name matches the current application ID.
Android configuration:
android {
defaultConfig {
applicationId = "com.example.app"
}
}
Firebase configuration:
"android_client_info": {
"package_name": "com.example.app"
}
The values must match exactly for the plugin to select the corresponding Firebase client configuration.
Fastest troubleshooting sequence
- Copy the package name shown in the error
- Check
applicationIdin the app-level Gradle file - Check build-type and product-flavor suffixes
- Search
google-services.jsonforpackage_name - If no exact match exists, register the correct Android app in Firebase
- Download a new official
google-services.json - Place it in the correct app module or flavor source set
- Clean and rebuild
Cause 1: Firebase contains the wrong package name
Example:
Actual applicationId:
com.example.todoapp
Firebase registration:
com.example.todo
Do not try to rename an existing Firebase Android app by editing the downloaded file. Add a new Android app to the Firebase project using the correct package name, then download its configuration.
Cause 2: applicationIdSuffix changes the final ID
The following debug configuration produces a different package name:
android {
defaultConfig {
applicationId = "com.example.app"
}
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
}
}
}
Final IDs:
release: com.example.app
debug: com.example.app.debug
If Firebase contains only com.example.app, the debug variant cannot find a matching client.
Register com.example.app.debug as a separate Firebase Android app when that variant uses Firebase.
Cause 3: A product flavor changes the ID
flavorDimensions += "environment"
productFlavors {
create("development") {
dimension = "environment"
applicationIdSuffix = ".dev"
}
create("production") {
dimension = "environment"
}
}
Register both final IDs when both environments connect to Firebase:
com.example.app.dev
com.example.app
Place the matching configuration in each flavor source set:
app/src/development/google-services.json
app/src/production/google-services.json
Do not confuse namespace with applicationId
Modern Android projects can configure these values separately.
android {
namespace = "com.example.app.code"
defaultConfig {
applicationId = "com.example.app"
}
}
Firebase normally identifies the installed application by its final applicationId, not by the source-code namespace.
Do not rely only on AndroidManifest.xml
Older projects often used the Manifest package attribute, but current app identity should be verified from Gradle.
Use this order:
defaultConfig.applicationId- Build-type
applicationIdSuffix - Product-flavor configuration
- The final package name shown in the error
The package name printed by the plugin is valuable because it reflects the actual variant being processed.
Do not manually rewrite the JSON
Changing only package_name may appear to move the build forward, but the file contains other linked values:
- Firebase app ID
- OAuth clients
- API keys
- Project number
- Other service configuration
Create the correct Android app registration and obtain a new official configuration instead of fabricating a match.
When the error occurs in Flutter
Check:
android/app/build.gradle
android/app/google-services.json
For Kotlin DSL:
android/app/build.gradle.kts
Review:
applicationId- Product flavors and suffixes
- The JSON under
android/appor the selected flavor directory - The Firebase project selected by
flutterfire configure
A clean build alone cannot fix a registration mismatch. Correct the package and configuration first.
When only CI fails
Confirm that local development and CI build the same variant.
Local: developmentRelease
CI: productionRelease
Also verify:
- Which
google-services.jsonCI restores - The restoration destination
- The chosen Gradle or Flutter flavor
- Whether production and development secrets are clearly separated
A valid development configuration still fails when CI builds the production package name.
Rebuild after correcting the configuration
Android:
./gradlew clean
./gradlew assembleDebug
Flutter:
flutter clean
flutter pub get
flutter run
For a Google Play AAB, confirm the production variant, final package name, signing configuration, and versionCode.
Summary
The central requirement is:
final applicationId
=
package_name in google-services.json
When troubleshooting, do not overlook namespace, debug suffixes, product flavors, or the build variant selected by CI.
For a broader explanation of the configuration file, see What Is google-services.json?.
Primary sources
Official references
- Google Services Gradle Plugin
- Firebase: Add Firebase to your Android project
- Android Developers: Configure the app module
Check the linked official documentation before a production release.
Continue reading
Related guides
TestCrew
Find testers through mutual testing
Test other Android apps, provide useful feedback, and use earned credits to recruit testers for your own Google Play closed test.
Learn how TestCrew works