google play application upload failed

15,537

Solution 1

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"
    }

Solution 2

You need to change your android:versionCode="1" to 2 on the AndroidManifest...

Solution 3

Things you have to keep in mind when updating your application on Google Play :

  1. Change Version code +1 depending on the old value - if it's 1 , you have to change it to a bigger number.

  2. 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.

Solution 4

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

Solution 5

Every time you update your app change this variable in you XML file:

android:versionCode="1"
Share:
15,537
My God
Author by

My God

Sr. Software Engineer (Information Technology) Technologies - Ruby ON Rails, Java/J2EE, Android Development. Certifications - Sun Certified Java Programmer (SCJP) Experience - 7 years Far better is it to dare mighty things, to win glorious triumphs, even though checkered by failure... than to rank with those poor spirits who neither enjoy nor suffer much, because they live in a gray twilight that knows not victory nor defeat.

Updated on June 21, 2022

Comments

  • My God
    My God about 2 years

    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" >
    
  • My God
    My God over 11 years
    The Google Play Upload still errors with the missing package name error.
  • My God
    My God over 11 years
    The Google Play Upload still errors with the missing package name error. However my package name is- com.corntail.main
  • PaNaVTEC
    PaNaVTEC over 11 years
    Have you changed your package name? You need to set the same as the previous version you uploaded, in this case com.corntail.project you cant change your package name between versions. Set package="com.corntail.main" to com.corntail.project
  • My God
    My God over 11 years
    But I will be able to submit the app again with a different name? Can I delete the current and Submit again as corntail?
  • My God
    My God over 11 years
    But I will be able to submit the app again with a different name? Can I delete the current and Submit again as corntail?
  • hardartcore
    hardartcore over 11 years
    Yes, you can delete the old one and upload the new with the new package name, but remember to update your version code and version name to 1 and 1.0 too.
  • My God
    My God over 11 years
    But after deleting the old one, if its new app, do I still need to update the version code and name?
  • PaNaVTEC
    PaNaVTEC over 11 years
    You can change the app name but not the package name.
  • hardartcore
    hardartcore over 11 years
    That depends on you, it's just better when releasing a new app in the store versions code/name to start from 1 and above. Don't forget to keep the same package name the next time when you will try to update your app!
  • My God
    My God over 11 years
    If I change the app name, then it will be treated as different app but not the update of the current app in google store. So should I delete the current one in order to submit my new one?
  • PaNaVTEC
    PaNaVTEC over 11 years
    If you change the app name it will NOT be treated as a different app. The play store only differences package names. And you can't delete a submitted app only unpublish.