I can’t update my app on google play?

Asked

Viewed 9,427 times

7

I know it is necessary to change the version number, but when I make the change and try to generate an apk gives error and shows me a message...

Error:XML version "2.0" not supported; only XML 1.0 is supported.

  • Everton, if the wakim’s response helped you, vote for her, if she’s the one, mark her as accepted, take a look here: http://meta.pt.stackoverflow.com/a/1079/6454

1 answer

15


I believe you’ve changed that:

<?xml version="1.0" encoding="utf-8"?>

For that reason:

<?xml version="2.0" encoding="utf-8"?>

Not correct, because this is the XML version that is used in Androidmanifest. It is necessary to keep as is.


To increment the version of your application you need to define and modify two properties, but how it is done depends on how you are doing the build of the app.

The two properties that say the version of your app are android:versionCode and android:versionName.

Versioncode

The Versioncode is an integer that represents the version of the code of your application, relative to other versions. You can even programmatically generate this value, it’s just a number that says when one application is newer than another. It has no relation to the version the user sees.

It is used only by Google Play and other stores, to know that there was an update on apk that you sent, thus making the distribution.

You can use any rule you want, even having spaces between versions. In my own experience I always increase in 1 with each update. If you upload an already used version, the Google Play will reject your upload.

Versionname

The Versionname is a String representing the version of release of your application. You can use the common notation of <major>.<minor>.<point> (e. g: 2.0.1) or any other form it deems appropriate. Because it is a String you follow the order you want, which makes no difference (The only problem is confusing the user).

This is the version that the user actually observes in stores.


As I mentioned, the setup will depend on how you do the build of your apk.

If you use ADT

Just modify the attributes android:versionCode and android:versionName on your tag manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.package.name"
    android:versionCode="2" <!-- Valor que as lojas usam para identificar que houve uma atualizacao -->
    android:versionName="1.1"> <!-- Valor que aparece para o usuario -->

    <application android:icon="@drawable/icon" android:label="@string/app_name">
    ...
    </application>
</manifest>

If you use Gradle

With Gradle, you can configure the versionCode and versionName in the build.gradle, but remember that it will always overwrite the value of the tag manifest. Otherwise it is the value of the tag manifest that will prevail.

Configuration example:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1        # Valor que as lojas usam para identificar que houve uma atualizacao
        versionName "1.0"    # Valor que aparece para o usuario
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

It is worth looking at the references for a better understanding.

References:

  • I did it, thank you very much!! @Wakim

Browser other questions tagged

You are not signed in. Login or sign up in order to post.