Changing Firebase Package Name
Solution 1:
As Eurosecom commented, you can just add a new Android app to your existing Firebase project with the new package name. After doing this, download the updated google-services.json and add it to your app.
Note that Firebase does not use the actual package name from your Java code, but uses the applicationId from your app's build.gradle file:
defaultConfig {
applicationId "com.firebase.hearthchat"
When you initially create a project in Android Studio, the package name and application id will have the same value. But if you refactor your code into a different package, the application id won't be updated. That explains why the app will continue to work after such a refactoring. But it can be confusing at times, which is why I prefer keeping them in sync.
Solution 2:
If you are using Firebase assistant then:
- Delete your app in the Firebase console in the project settings.
- Back in Firebase assistant reconnect to the Firebase for any service.
- It will ask you to sync with the project. Click on Sync.
- The app with new package will be added and the
google-services.json
file will be automatically updated.
Also note that the package name of the applicationId
value in the build.gradle
file is considered.
Cheers
Solution 3:
There's a better way of resolving this issue.The error can be as result of you having a GoogleService Json file in your app folder, All you need to do is; try and locate your google-service.json file under app folder, and change the package_Id to the new package_id you have created; Save, Do a Clean and Rebuild Project, your problem would be resolve. Hope this will help you. It works for me. You can kindly votes if this also help you. Thanks
Post a Comment for "Changing Firebase Package Name"