JGallardo
JGallardo

Reputation: 11373

Uploading a new APK to production. For new version of an Android app.

This is not a duplicate because the other similar questions are very incomplete. So I am asking for the gaps in information.


I just added an update to my app. I followed examples on this site that said to update the code like this adding the versionCode and versionName. The instructions said to increment the code by 1, and the version to whatever I want it called. So I have this.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="juangallardo.emofortunecookie"
    android:versionCode="2"
    android:versionName="1.1.0">

Then I hit Build --> Clean. Then build --> Generate Signed APK

enter image description here

then chose release

enter image description here

Then I uploaded what was generated. I did check to make sure that the file was just recently modified to ensure that I was not uploading a previous file. But I got this error.

enter image description here

Upvotes: 1

Views: 1125

Answers (2)

Valters Jansons
Valters Jansons

Reputation: 3962

You do not need to specify the version information in the manifest manually for an Android Studio project and you instead have to modify the Gradle build file.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="juangallardo.emofortunecookie">

app/build.gradle

defaultConfig {
    applicationId "juangallardo.emofortunecookie"
    [..]
    versionCode 2
    versionName "1.1.0"
}

Upvotes: 2

MadEqua
MadEqua

Reputation: 1142

It seems you're using Android Studio. You'll have to edit your build.gradle which may be overiding your manifest settings.

android {
    ...

    defaultConfig {
        versionCode 2
        versionName "1.1.0"
         ...
    }

Upvotes: 2

Related Questions