Android studio after renaming package it throws No

2020-06-07 03:44发布

问题:

I followed the below link for renaming the package. After renaming when i try to build the projects android studio throws error like.

Android Studio Rename Package

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

回答1:

You have added the Google Play Services plugin to the project, which reads from the google-services.json found in your app module.

The google-services.json contains service configuration data, such as Google Project ID, application package name, etc..

Since the application package name is also stored in that json, it will not match anymore, so you have to create a new application in your Firebase console, and export the new configuration json.

Then replace the google-services.json in your project with the one you have generated.



回答2:

I had the same issue when I renamed my package. I created a new Firebase project from firebase console and downloaded the new google-services.json file from the firebase console and replaced it with the old one but still got the same error. Then I checked my build.gradle (App) file it still had the previous package name so I renamed it with the new package name and it worked.



回答3:

Look for the names of package and created project in firebase must be same



回答4:

I am facing the same issue. I had changed package name and app id and refracted all class files to new one. But i forgot to change new package name to google-services.json



回答5:

Also, make sure you don't have the old google-services.json file in your app directory or app/src/debug (buildType directory actually)