You get a bonus - 1 coin for daily activity. Now you have 1 coin

Amazon app store - error uploading updated version of app - Failed to upload APK

Practice



When uploading an app to the Amazon App Store, an error appears about the updated version of the app - Failed to upload APK. The version codes of all uploaded App files in an app must be unique. The APK you just uploaded with version code 1 conflicts with the version code of an existing App file in one of the previous versions

Amazon app store - error uploading updated version of app - Failed to upload APK

The error means that the APK version you are trying to download uses the same version code as a previously downloaded APK. For each new version of the app, the version code must be unique and incremented.

How to fix:

  1. Open AndroidManifest.xml or build.gradle:

    • If you are using Gradle, find the following line in the build.gradle file in the app module (usually app/build.gradle):
      gradle versionCode 1
    • Make sure the versionCode is incremented. For example:
      gradle versionCode 2
  2. Check versionName:

    • Typically, next to the versionCode there is a versionName line that displays the version to users:
      gradle versionName "1.0"
    • You can update it to a newer number (for example, "1.1", but this is not necessary).
  3. Rebuild the APK:

    • After changing versionCode, rebuild the application:
      • In Android Studio: Build > Build Bundle(s)/APK(s) > Build APK(s).
    • Make sure the new APK uses the updated versionCode.
  4. Please try downloading again:

    • Download the new APK from the Amazon App Store.

Note:

  • versionCode should be a number that increases with each new version (e.g. 2, 3, 4, etc.).
  • versionName does not have to be numeric. This is stated by the site https://intellect.icu . You can use strings like "1.1", "1.2-beta" and so on.

If the error continues to occur, please check if you are downloading the correct APK file.

How to fix this in unity

Amazon app store - error uploading updated version of app - Failed to upload APK

In Unity, changing the application version is done through Player Settings.

Here are the steps to check and change versionCode and versionName:

Steps to check and change APK version in Unity:

  1. Open Player Settings:

    • In Unity, go to Edit → Project Settings → Player.
  2. Select Android platform:

    • On the left side of the Player Settings window, select the Android tab.
  3. Find the version parameters:

    • Scroll down to the Other Settings section.
    • Find the following parameters:
      • Bundle Version Code: This is the versionCode. It must be unique and incremented with each new version.
      • Version: This is the versionName. You can change it to display to users (e.g. 1.0, 1.1, 2.0).
  4. Update Bundle Version Code:

    • Increase the Bundle Version Code value by 1 (for example, if it is currently 1, change it to 2).
    • If you want, update Version (for example, from 1.0 to 1.1).
  5. Save the changes and rebuild the APK:

    • Click File → Save Project.
    • Rebuild the APK:
      • In Unity: File → Build Settings → select Android → Build or Build and Run.

Checking the version in the compiled APK:

  1. Open the APK file using ADB or any archiver:

    • APK is an archive. You can open it with an archiver (for example, WinRAR or 7-Zip).
    • Inside, open the AndroidManifest.xml file.
  2. Check versionCode and versionName:

    • In AndroidManifest.xml find the lines:
      xml  
      android:versionCode="2" android:versionName="1.1"
  3. Use ADB command to check the version:

    • Connect the device to the computer.
    • Run the command:
      bash
      adb shell dumpsys package  | grep version
    • Replace with your application's ID (e.g. com.example.mygame).
    • You will see the current versionCode and versionName values.

Download APK from Amazon App Store:

Once verified, upload the new APK with a unique versionCode to the Amazon Developer Console.

The Entity of Bundle Version Code (aka versionCode) in Unity for Android

Bundle Version Code (aka versionCode) in Unity for Android must be an integer. This value is used to internally identify app versions on Google Play, Amazon App Store, and other platforms. It is not displayed to users.

Rules for Bundle Version Code:

  1. Integer:

    • Example: 1, 2, 3, 100.
    • Don't use periods or symbols - only whole numbers.
  2. Increase by one or more:

    • Each new version must have a versionCode greater than the previous one. For example:
      • First version: 1
      • Second version: 2
      • Third version: 3
  3. Does not affect Version:

    • Version (aka versionName) is used for display to users and can be a string with dots, for example: 1.0, 1.1, 2.0.
    • These values ​​are not related, but should be updated synchronously for clarity.

Example of setup in Unity:

  • Bundle Version Code: 2
  • Version: 1.1

If you try to upload an app with the same Bundle Version Code that is already in use in the store, you will get an error. Make sure that this value is increased with each update.

created: 2024-12-30
updated: 2024-12-30
17



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Software and information systems development

Terms: Software and information systems development