I'm new to android application development. I'm creating simple android application.
Export the android application and give the package name as AndroidManifestfile packagename as
com.example.zingyminds.apk
Now I got the apk file and upload to the google play at that time I got the below error message please anyone help me.
The package name of your apk may not begin with any of the following values: [com.android, com.google, android, com.example]
Packages are typically named using the following convention:
[org/com].[company].[product].[component]
By convention, package names should not contain capitals.
Google Play identifies all the applications on the basis of their package name, so some of the names are reserved for the default applications of the android, like you have mentioned in the last paragraph,
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
com.zingyminds.apk
Rename your package name com.example.zingyminds.apk to com.zingyminds.apk
Google Play doesn't care about the filename of your application. It cares
about the package name defined in the manifest.
If you observe properly, the fourth value in error message is 'com.example' which is same as starting of your package com.example.zingyminds... Rename your package to something else which is not listed in the message, it will solve your problem.
Packages are typically named using the following convention:
[com.android, com.google, android, com.example]
so, these package name are discouraged and you should use the upper conventions for describing the package name, something like this,
if you want to mention example in your package name, try this
com.zingyminds.example.apk
Related
I've recently started creating an app for Android. but i do not have a Website.
how to get Package name. Can i make it com.example.(app name) ?
and how to know if it is available or not ?
package name have no concern with any website. It is used to identify your application uniquely in your mobile phone and in any App store. You can set any name or string in your package name i.e com.example.myfirstapplication
it is not necessary that there should be com.example in the package name you can change them also i.e my.first.application.packagename
You can set whatever package name you like, as long as it isnt already taken when you publish it on the playstore.
More good reading: https://stackoverflow.com/a/6273935/5644761
What is the difference between changing package name vs applicationId to the final apk.
I know it is different for aspect of keeping source code, but lets say I got some app with package name a.b.c.d.
What will be the difference in the builded apk file
if I rename the a.b.c.d into q.w.e.r and then build the apk file
vs
change the applicationId into gradle with q.w.e.r
The package name is just to organize your code.
The applicationId, on the other hand, is used to identify your app in the Play Store. You will change this only if you plan to generate another app based on same code.
From docs (https://developer.android.com/studio/build/application-id.html):
When you create a new project in Android Studio, the applicationId
exactly matches the Java-style package name you chose during setup.
However, the application ID and package name are independent of each
other beyond this point. You can change your code's package name (your
code namespace) and it will not affect the application ID, and vice
versa (though, again, you should not change your application ID once
you publish your app). However, changing the package name has other
consequences you should be aware of, so see the section about
modifying the package name.
Some Android API like google map and firebase ask for your package name when you create the key. That package name they refer to is actually your applicationId. Yup Google insist on using the term package name for these API key. Don't get it confuse.
Taken from doc (https://developer.android.com/studio/build/configure-app-module#set_the_application_id):
"Note: The application ID used to be directly tied to your code's package name; so some Android APIs use the term "package name" in their method names and parameter names, but this is actually your application ID. For example, the Context.getPackageName() method returns your application ID. There's no need to ever share your code's true package name outside your app code."
Application id mostly used for:
Change the application ID for testing
Change the application ID for build variants
In this case, each build variant should be defined as a separate
product flavor. For each flavor inside the productFlavors {} block,
you can redefine the applicationId property, or you can instead append
a segment to the default application ID using applicationIdSuffix, as
shown here:
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.
And package name is:
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:
The Android build tools use the package attribute for two things:
1- It applies this name as the namespace for your app's generated R.java
class.
Example: With the above manifest, the R class will be
com.example.myapp.R.
2- It uses it to resolve any relative class names
that are declared in the manifest file.
Example: With the above
manifest, an activity declared as is resolved to be
com.example.myapp.MainActivity.
Know more from Source
Once you upload the app on Play store you can't change the application id for that project , if you want to do then google play store consider as a different application.
In case of package name you can change it as you want.
I have a problem while uploading .apk file. When I try to upload .apk file, I always get the same error:
Its says that I need to name the app file, something like this: com.example.myapp.
The .apk names that I tried (examples): com.rvislt.prosld.apk, com.rvislt.prosld2014.apk and I always got the above error.
I tried to use the different browsers, shutdown all background application and I always got the same error.
It makes me crazy!
What is the problem and how can I fix it?
You are simply renaming the APK file name, try to change your package name of your application.
Like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rvislt.prosld"
android:versionCode="1"
android:versionName="1" >
Renaming the APK file to com.rvislt.prosld.apk does not make any sense and it wont work for you.
Try to change Package Name into your manifest.xml file with com.rvislt.prosld and built again and for the naming conversation go to http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Its not necessary that it always start with .com.
Generally we android developer having practice to decide package name based on the domain name of a particular company.
For example:
1. Domain name: sun.com => Root package name something like : com.sun
2. Domain name: technotalkative.com => Root package name something like: com.technotalkative.android
3. Domain name: sun.org => Root package name something like: org.sun.androidapp
And for more information, What should be the package name of android app?
After having refactored your project to use new package name try to use a find-replace in your project and replace com.youroldpackage.app with com.yournewpackage.app with eclipse.
There are several places where your app page name is used: Manifest etc. java packages etc. make sure that everywhere is used your new package now.
BTW: a good practice for package naming is to use a domain that you own in it, that way you can be almost sure that nobody else uses the same package name, which is a problem, because you cannot upload apps with a package name that is already in use. so for example if you have the domain "mynewpackage.com" then your app packagename should be something like com.mynewpackage.mynewapp
I am trying to submit an application to the marketplace but when I try to upload I get a message:
The package name of your apk (xxx.xxxxxx.xxxxxxxxx) is the same as
the package name of another developer's application. Choose a new
package name.
My company has two apps in market already but the package names are distinct. I have queried the address https://market.android.com/details?id=xxx.xxxxxx.xxxxxxxx to check to make sure that it's not mistakenly identifying one of our other apps but it comes up as "Not Found" which should mean that this package name doesn't conflict.
Is there something else I should try to get this to work? I am going to try a small change to the package name and see if it will pass but this error shouldn't have occurred in the first place.
Maybe the package id does exist, but the application is in an unpublished status at the moment.
Is better to rename the package in this way you avoid having problems.
Change the package name or contact google support
During the upgrade of my android application, I changed the package name. But Android market doesn't allow to upload the changed package name application as an upgrade. If I upload the application as a new application, will the user have two applications on his/her device? How can I make sure that the user doesn't have to download the application again from scratch without reverting the change of my package name?
two package = two different application in market place.
Once you upload one app, its package should be same. Also, the key should be same.
Android market is only concerned about the package name in your manifest, not the actual packages name in the source.
You could try to give the old package name in the manifest attribute, then for activities give the new package name instead of relative (ie .MainActivity)
Like this:
<manifest package="your.old.package" ...>
...
<application android:name="your.new.package.MainActivity" ...>
Could work..
I plan to serve two versions of my app (paid/free) this way and using same project and code.
If you change the package name, it's treated as a separate app - not just in the market, but apk's in general will only 'replace' the same package name (and only if they're both signed with the same key).
Although it's possible to phase over to a new key by signing an intermediate package with both keys, there's currently no easy way to phase over the package name.
The best that can be done is this:
New apk version is signed with the same key, but has a different package name.
When installed, the new apk arranges to use the shared_prefs with the old package name.
The data is copied across to the new package name.
The new version requests that the old version is removed, and the user sees the uninstall dialog.
Note app data is usually kept here:
/data/data/pac.kage.name/
I haven't tried this, so I can't give anymore details yet. You may also be interested in my request for a seamless way of transitioning the package name.