chronotrigga
chronotrigga

Reputation: 609

Need to use different version code, PhoneGap

I am receiving a duplicate version code error when I try and upload a new version of my APK to Google Play. I am using build.phonegap.com and I did some research and found it was either the AndroidManifest.xml file or config.xml file. I have manually tried editing these using Sublime Text 2 (my config.xml is in /platforms/android/assets/www) but nothing I have edited seems to work. The version was originally 2.1.1 and VersionCode 20101.

Does anyone have any idea on how to approach this and fix my VersionCode so that I can upload it?

enter image description here

config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" 
    xmlns:gap="http://phonegap.com/ns/1.0"
    id="final.com.treatfinder" 
    version="2.1.2" >
<name>MedicineFinder</name>
<feature name="http://api.phonegap.com/1.0/device" />

AndroidManifest.xml:

<?xml version='1.0' encoding='utf-8'?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="final.com.treatfinder"
    android:hardwareAccelerated="true"
    android:versionCode="20103"
    android:versionName="2.1.2"
    android:windowSoftInputMode="adjustPan">

Upvotes: 2

Views: 2785

Answers (2)

chronotrigga
chronotrigga

Reputation: 609

Found the problem. Although I updated both the AndroidManifest.xml and Config.xml, your VersionCodemust be incremental. For example, if it shows 3 in use, you must use 4.

Upvotes: 1

Mattia Maestrini
Mattia Maestrini

Reputation: 32780

Try to add versionCode to your config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" 
    xmlns:gap="http://phonegap.com/ns/1.0"
    id="final.com.treatfinder" 
    versionCode="20103"
    version="2.1.2" >
<name>MedicineFinder</name>
<feature name="http://api.phonegap.com/1.0/device" />

versionCode: (optional) when building for Android, you can set the versionCode by specifying it in your config.xml.

Reference: http://docs.build.phonegap.com/en_US/3.1.0/configuring_basics.md.html#The%20Basics

Upvotes: 4

Related Questions