Having trouble changing package in Android app using Firebase - android

Cannot upload app to Google Play because of wrong package name (I included the keyword 'android' in the package name). I tried changing the package name everywhere but this conflicts with the google-services.json file (I am using Firebase in this app). I tried creating a new app within my Firebase Console with a different package name and then I downloaded and placed the new google-services.json file in the right place. The app still doesn't work (Users cannot authenticate in my app). Any suggestions?

Related

Google playstore does not identify the new package name?

I created an app using Android Studio. And linked firebase as backend. While publishing on play store google informs me that there is another app with the same package name. So I go back and change the package name in and AndroidManifest file and rebuild the apk. On uploading, the apk google still says the same error with an old package name. I read somewhere that we have to change the applicationId in a build.gradle file also, but this id is used by firebase to identify the app. Hence I can't do this , so how to solve this problem?
If I'm not wrong, you should create a new application in your developer google console to upload your application with the new package name. You can't modify a package name after upload an application:
Things That Cannot Change:
The most obvious and visible of these is the “manifest package name,”
the unique name you give to your application in its
AndroidManifest.xml. The name uses a Java-language-style naming
convention, with Internet domain ownership helping to avoid name
collisions. For example, since Google owns the domain “google.com”,
the manifest package names of all of our applications should start
with “com.google.” It’s important for developers to follow this
convention in order to avoid conflicts with other developers.
Once you publish your application under its manifest package name,
this is the unique identity of the application forever more. Switching
to a different name results in an entirely new application, one that
can’t be installed as an update to the existing application.
You need to change applicationId with same package name in build.gradle file.
In android studio applicationId is considered as package name for play store. so change applicationId to change package name. It will help you.

Does Firebase Cloud Messaging depend on the package name?

I want to know if package name, defined on Firebase project console, is tightly related to Firebase Cloud Message successful delivery or it's just a helper for creating google-services.json file.
On Firebase console, once created it can't be renamed.
In my case I created a project at Firebase console named, by mistake, son.example.firecm instead of com.example.firecm as defined on my Android Studio Project.
My Android project was not compiling cause gap on spelling at google-services.json.
Once renamed package name to com.example.firecm, it compiled but not sure if it will receive Firebase Cloud Messages or not cause difference between Firebase console project package definition at Android Studio project.
Having the right package name is important for several services, though not FCM specifically, other than getting it right in the google-services.json as you found. FCM uses the project number to identify the app, which will be read from the JSON file.
The best thing to do is just to connect a new Android app to your Firebase project with the correct package name, and download the updated google-services.json. It wont hurt to have the other package name connected (and once the console allows deleting connected apps, you should be able to remove it).
Well I did further research on the same.
I found that if package name defined on Firebase Console isn't the same as defined on Gradle and Manifest of the APP, then the APP won't be able to receive Notifications sent from Firebase Console.
In guess that in some way it's logic that package name must match in order to Android lunch the correct APP once notification arrives.
To sumarize, it's mandatory that both names matches.
I invite to test by yourself and keep and eye on package names for project success.

I get the package name already used error when uploading android app

When uploading the android app in Google Play, I got the error saying that the package name is already used. Instead of changing the package name everytime I upload the updated app, what are the other ways?
That tells you that another app with the same package name already exists. You have to change the package name in your java files, the Manifest / the Gradle file depending on the build type you use.
You cannot have another application with the same package name on the PlayStore, so there is no other way than changing the package name permanently.

Remove company name in android package

A while back I created a phonegap android app and put it on the google play store with the package name com.packagename I have since rebuilt the app in native code using android studio. Having just tried to update the app on google play and found that the package name does not match because android studio adds a company section i.e. com.companyname.packagename
I have tried refactoring but there does not seem to be a way to remove the companyname section. Is there anyway to do this? I am assuming there is no way around this in google play?
Is there anyway to do this?
Go into build.gradle and delete companyname from the applicationId values. Then, double-check your AndroidManifest.xml file and delete companyname from the package attribute in the root <manifest> element.

Android App Publishing Upgrade: Same Key But Dev Console disagrees!

I am trying to publish an upgrade to my app in Android Market. I am using the same key and alias as before (I have only one key and a single alias). But I get the error "The apk must be signed with the same certificates as the previous version.". This is not the first time I am uploading upgrades. Never had problems before.
The only difference I have this time is I added a new sub-package to the project. My base package is "in.vasanth.android.droidsave". I added a package "in.vasanth.android.droidsave.db". Does adding a package affect the upgrade? Or did I some how mess up my key?
Make sure that you are uploading an exported .apk file, not the one that is normally built in the project's bin directory. Adding a sub-package won't affect anything as long as you haven't changed the package name for the overall application in the manifest file.

Categories

Resources