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?
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.
I think the problem here is that you have multiple build types in your gradle.
try and add a suffix according to the build type in the json file.
This might solve the error.