Skip to main content

No matching client found for package name

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:

  1. Open the google-services.json file, which is typically located in the android/app directory of your Flutter project.

  2. Look for the package_name field in the google-services.json file. This should match the package name you intend to use for your application.

  3. Next, open the build.gradle file in the android/app directory of your project.

  4. In the build.gradle file, locate the defaultConfig section. Inside this section, you will find the applicationId property. Make sure that the value of applicationId matches the package name specified in the google-services.json file.

  5. If the package name and application ID are not the same, update either the package_name field in the google-services.json file or the applicationId property in the build.gradle file to match each other.

  6. Save the changes made to both files.

  7. 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.