androidcordovaionic-framework

Can't Publish Another App on PlayStore: "Use another code version for your app"


I just finished an app with Ionic Framework and when I tried to upload for the 2nd time my app, after Google ask for corrections, I'm getting this error:

Use another code version for your app...

I've searched in a lot of places including here on StackOverflow, but couldn't solve the issue.

I'm using crosswalk with Ionic. And here's my files for reference: (Now, after a lot of changes...)

Was I who changed to company and appname ok

config.xml

ORIGINAL VALUE

<widgeT
      id="br.com.company.appname" 
      version="0.0.1"
      xmlns="http://www.w3.org/ns/widgets" 

NOW

<widget 
      id="br.com.company.appname" 
      version="2.2.2"
      versionCode="100" 
      android-versionCode="100" 
      xmlns="http://www.w3.org/ns/widgets" 
      xmlns:cdv="http://cordova.apache.org/ns/1.0">

build.gradle

android {
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }
    }

    defaultConfig {
        versionCode 100
        versionName "2.2"
        //versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode"))
        //versionCode 17
        //applicationId privateHelpers.extractStringFromManifest("package")

        //if (cdvMinSdkVersion != null) {
        //    minSdkVersion cdvMinSdkVersion
        //}
    }

    lintOptions {
      abortOnError false;
    }

The commented code above is the original.

AndroidManifest.xml (which I can't alter, just for reference)

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="100" android:versionName="2.2.2" package="br.com.company.appname" xmlns:android="http://schemas.android.com/apk/res/android">

I build the release app with theses commands:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore appname.keystore appname-armv7-release-unsigned.apk appname

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore appname.keystore appname-x86-release-unsigned.apk appname

C:\android\sdk\build-tools\23.0.2\zipalign -v 4 appname-armv7-release-unsigned.apk appname_armv7.apk

C:\android\sdk\build-tools\23.0.2\zipalign -v 4 appname-x86-release-unsigned.apk appname_x86.apk

I build the armv7 and x86 arch. And both are on Google.

The armv7 is on version 12
The x86 is on version 14

And no matter what changes I make on the files above, the Google still says the code version has to be different from 12 / 14....


Solution

  • Need to set proper version and version code name

    Example First Release versionCode 1 versionName "0.1"

    Second Release versionCode 2 versionName "1.0"