THE SITUATION:
Sorry in advance if this question has been asked already three times. But none of those solutions are working for me.
I need to upload a new version to Google Play of my Ionic app. The upload process it has always worked fine but this time i get this error:
You need to use a different version code for your APK because you already have one with version code 101078.
THE PUBLISHING PROCESS:
I am not using Android Studio.
To publish the app i was simply building and signing the app through the command line and then upload it in the Google Developer Console.
For a new version i was simply updating the version number in the config.xml before creating the apk.
APP VERSIONS:
Old version: (status published on Google Play) 1.1.7 Code version: 101078
New version: (trying to upload on Google Play) 1.1.10
ATTEMPTS TO RESOLVE:
I have tried to manually set the Code version to higher number. At the moment i have this settings in the ./config.xml:
<widget id="com.myapp.myapp" version="1.1.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
In the file ./platforms/android/AndroidManifest.xml I manually change the settings to:
<manifest android:hardwareAccelerated="true" android:versionCode="101079" android:versionName="1.1.10" package="com.meetinghand.meetinghand" xmlns:android="http://schemas.android.com/apk/res/android">
But after i run cordova build --release android
that value is automatically reset to android:versionCode="10110" ...
RUNNING AAPT:
Running the sdk tool aapt on the apk file i get the following:
name='com.myapp.myapp' versionCode='101078' versionName='1.1.7' platformBuildVersionName='6.0-2704002' sdkVersion:'16' targetSdkVersion:'22'
THE QUESTION:
What's going on?
How exactly is the versionCode set? Can I hardcode it? Why, no matter what I do, does the versionCode remain at 101078?
Why is versionName 1.1.7 and not 1.1.10 as it is clearly stated in the config.xml?
I don't know what else can I do.
If you solve this riddle I will build a sculpture in your honor!
Thank you!
EDIT:
In the end i decided to uninstall CrossWalk because didn't strictly need its benefits. In this way the issue was resolved and I could upload the new version.
I could indeed hardcode the code version inside the config.xml as pointed out by @e666:
<widget android-versionCode="101079" id="com.myapp.myapp" version="1.1.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
The versionCode was not overwritten by Crosswalk but was properly set as 101079 and in this way i could upload the apk as new version.
If you still want to keep Crosswalk and upload the new version you can do it by switching to Advanced Mode in the Google Developer Console. Keep in mind the Crosswalk will export two apk (armv7 and x86) and you will need to upload both.
For more reference about how to do you may check out this answer: