No matching client found for package name
Estimated reading: 1 minutes
If you encounter the error message "package_name" in google-services.json
is not matching with your "applicationId" in the app gradle, it means that there is a mismatch between the package name specified in the google-services.json
file and the applicationId
defined in your app's build.gradle
file.
To resolve this issue, you need to ensure that the package name and application ID are the same. Here are the steps to follow:
Open the
google-services.json
file, which is typically located in theandroid/app
directory of your Flutter project.Look for the
package_name
field in thegoogle-services.json
file. This should match the package name you intend to use for your application.Next, open the
build.gradle
file in theandroid/app
directory of your project.In the
build.gradle
file, locate thedefaultConfig
section. Inside this section, you will find theapplicationId
property. Make sure that the value ofapplicationId
matches the package name specified in thegoogle-services.json
file.If the package name and application ID are not the same, update either the
package_name
field in thegoogle-services.json
file or theapplicationId
property in thebuild.gradle
file to match each other.Save the changes made to both files.
Clean and rebuild your project to ensure that the changes take effect. You can do this by running the following command in the terminal within your project's root directory:
flutter clean
flutter run
Following these steps should resolve the package name mismatch error and ensure that the google-services.json
file and the build.gradle
file have consistent package names.
For more detailed information, you can refer to the Firebase Configuration documentation.