Google Play Console Package Name - android

I have one application of Trivia, the package name is es.test.triv.sh, there are all things for play one player, I have add a new feature is a multi-player options, for this option I have use the real-time of google play, and I have to register the application with the package, here is the problem the implantation of this feature for multiplayers is on new module of android and have a different package com.stas.triv.mlt
https://developers.google.com/games/services/console/enabling#c_specify_client_id_settings
On this point I have to set com.stas.triv.mlt or es.test.triv.sh?

That package name always refers to the package name that Google Play console uses for your Application Id.
It used to be the one in the manifest.xml of your application
<manifest package="tv.potato.baked"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="#string/app_name"
>
.
.
But on (recent versions?) of Android Studio, this package is ignored, and the one defined in your application module's build.gradle is the one used:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "tv.potato.baked"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
.
.
.
That package name also defines your app name in the playstore (look at the url), so once the app has been published for the first time it cannot be changed.

Related

What is the difference between Package name & App Package Name?

I'm practising Android Program with a book
and it says if the package name is same, android understand it's same app even if the project is different.
so, I changed it with Refactor.
and it also says if you want to change app package name too, then please change the application ID in build.gradle(Module:app)
what is the difference between Package name & App Package Name?(Maybe the name is wrong because I just translate it.)
Every Android app has a unique application ID that looks like a Java package name, such as com.example.myapp. This ID uniquely identifies your app on the device and in Google Play Store. If you want to upload a new version of your app, the application ID (and the certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. So once you publish your app, you should never change the application ID.
android {
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
...
}
Although your project's package name matches the application ID by default, you can change it. However, if you want to change your package name, be aware that the package name (as defined by your project directory structure) should always match the package attribute in the AndroidManifest.xml file, as shown here:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >

Not working with package name and firebase

I have an app uploaded to the play store. The package is: com.pathapp but then with gradle are generated two apk, com.path debug and release (without app). Now I want to integrate firebase, but I do not know what name of the app is what I have to put in firebase, if com.path or com.pathapp in order to have a well constructed google-services.json file.
If I change the original package of the directories from pathapp to path, there would be a problem?
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.00"
}
}
applicationId in the gradle is your package name.
So you need to add that in the firebase console.
In the above example, the package name is com.example. Likewise, check your gradle.
If you go to the Play Store you can see the package name of your current app. Use this, or you won't be able to upload in the store.
To see the package name is linked with your Firebase, open your project in Firebase and click on Settings, here you will see the package name of the app.
If is not the same:
-There, you can see an option to add a new app. Click the button and add a new app with your new package: com.pathapp
-Finally, you have to download the new google-services.json and add it in your project, deleting the old one if you still have it.

Android package name

What is the mean of applicationId in build.gradle. and what is the difference between package name in manifest file and applicationId in build.gradle.
What is the mean of applicationId in build.gradle
Every Android app has a unique application ID that looks like a Java package name, such as com.nilu.myapp. This ID uniquely identifies your app on the device and in Google Play Store. If you want to upload a new version of your app, the application ID (and the certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. So once you publish your app, you should never change the application ID.
Read more about applicationId
what is the difference between package name in manifest file and applicationId in build.gradle
package specified in AndroidManifest.xml identify one application installed on the device
Read more from this answer and this also Package Name Vs Application ID
applicationId in build.gradle will overwrite the manifest file's package value. And in build.gradle file you can use productFlavors to define different flavors, and each flavor can have different applicationId.
productFlavors {
free {
applicationId "com.myapp.free"
}
paid {
applicationId "com.myapp.pro"
}
}

Error with updating new APK on the developer's console

I have been trying to update my app with the new version and I run into this problem on the developers console. I have such error:
I checked with the version of my previous version to see if I was doing something wrong, but it was the same.
Here is my updated xml file
<application
android:allowBackup="true"
android:id="#+id/title"
android:icon="#mipmap/iron"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:versionCode="100"
android:versionName="2.0"
>
Looks like you already have version 1. in the play store. To be able to update it, you need to change the version number in the build.gradle file in your android project.
Sync your project, then generate the new APK.
I doubt if just updating the manifest will work.
In order to define your app version dynamically, specify a custom method with def and call it, as such in your .gradle:
def computeVersionName() {
return "2.0"
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
versionCode 12
versionName computeVersionName()
minSdkVersion 16
targetSdkVersion 16
}
}

google play application upload failed

apk upload failed to the google play market.
I am trying to upload the upgraded version of my app to the google play but I am keep getting the message -
Upload failed
You need to use a different version code for your APK because you already have one with version code 1.
Your APK needs to have the package name com.corntail.project.
There is still something that is looking for com.corntail.project and it is not being found.
UPDATE:
In my AndroidManifest.xml, the relevant code is -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.corntail.main"
android:versionCode="1"
android:versionName="1.0" >
If you're using Android Studio or building with gradle, edit your gradle script (build.gradle) to change your package name and version. These values overwrite your AndroidManifest.xml file.
For example:
defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 16
targetSdkVersion 19
versionCode 2
versionName "1.1"
}
You need to change your android:versionCode="1" to 2 on the AndroidManifest...
Things you have to keep in mind when updating your application on Google Play :
Change Version code +1 depending on the old value - if it's 1 , you have to change it to a bigger number.
Change your App Version Name to something bigger / different if it's string - if your old version is 1.0 - it should be 1.1 / 1.0.1 or whatever you like (it's always a better option t have some version name strategy, if it will contains the date update addded or the revision it depends on you).
And if you want to be able to update your app, don't change project package name! That's how android system knows that this application is different than that one. If you change your package name, it's now acting like a new app and you won't be able to update it from Google Play Store! To change your package name to com.corntail.project first you need to change it in manifest and after that in your project's main package and you need to keep track of your activities, if you declared them with package name too. For example :
if your MainActiivty was declared in manifest like :
com.corntail.main.MainActivity
you need to change it now to be like :
com.corntail.project.MainActivity.
You need to use a different version code for your APK because you
already have one with version code 1.
You must change your version code in your androidmanifest.xml
Every time you update your app change this variable in you XML file:
android:versionCode="1"
You are getting 2 errors.
The Version Code: you always need to set a higher number in the versionCode and always use an integer number. (don't use 1.1)
android:versionCode="1"
The package name: it has to match the same string that you used in the latest version that you upload. So instead of package="com.corntail.main" you should use:
package="com.corntail.project"
After modify the AndroidManifest.xml save it and then search in the folder src the package called "com.corntail.main", right click, Refactor > Rename, and the new name should match what you put in package (in this example you should call it: 'com.corntail.project') and you are done!
Good luck!
You have change version code in increasing order i.e. 1,2,3...so on as every time you uploaded. In every upload version code should have greater number than previous upload version code. You can change version code in APP Module Build.gradle file.
Image
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.xyz"
minSdkVersion 14
targetSdkVersion 24
versionCode 5
versionName "1.1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
If you build with gradlew, you should check the build.gradle file,
the applicationId will overwrite the package value in the AndroidManifest.xml
android {
defaultConfig {
applicationId "xxx.xxx.xxx"
}
}

Categories

Resources