Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Firebase: No matching client found for the package

I had borrowed an android project from one of my friends and after importing, I got an error that the The application was configured for some other audience - appId doesn't match the one in google-services.json. After that, I knew I had to change the package name of java files and reconnect firebase so, I did. I keep getting an error:

Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.***.***.chitchat'

I have the same package name in AndroidManifest.xml, build.gradle and google-services.json. Strange is that everyone got their problem solved after making the required changes. Mine still throws an error. Why is that?

like image 317
Muhammad Talha Akbar Avatar asked Dec 08 '17 20:12

Muhammad Talha Akbar


People also ask

What is the Android package name?

The package name of an Android app uniquely identifies your app on the device, in Google Play Store, and in supported third-party Android stores.

Where does Google services save JSON?

The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).

Can I change package name in firebase?

xml file and change the application package name to the new one. Next go to the Firebase Project and delete the previous app and create a new one with new android package name. to add new app to the Firebase Project click on android icon. Next enter new credentials into the required fields.


1 Answers

The package names of your Java code actually has nothing to do with that error. It's the application id of your entire app that you need to look at (in your build.gradle).

The google-services plugin looks at your application id and tries to match it against a package name that it fines in your google-services.json file. If there is no match, it will give you that error. To resolve this, either change your application id in build.gradle to match the package name that was set up for your app in the Firebase console, or create a new app in the console with a package name that matches your application id.

If you borrowed a project from a friend, I suspect that you also got a hold of their google-services.json, which you typically don't share or check into source control, unless everyone has full access to the same project. If you're working in your own project, you'll need to set that up in the console and generate a new google-services.json to match your app.

like image 148
Doug Stevenson Avatar answered Oct 10 '22 07:10

Doug Stevenson