How to change Version Code (Android)?

You must Login before you can answer or comment on any questions.

I tried manually modifying Version in AndroidManifest XML, and also tried to change it in Titanium Edit tab (Version:), but Google Android Market still complains about Version as it sees as same Version Code 1 all the time.

— asked 3 years ago by Ashok Patel
1 Comment
  • Im having this issue to. It seems the manifest file is not being updated - seems odd that this is still happening a year on.

    — commented 2 years ago by Matt Bourne

5 Answers

Accepted Answer

You Need to bump both android:versionCode and android:versionName

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.appcelerator.aidori" android:versionCode="5" android:versionName="1.4" >

— answered 3 years ago by Tony Guntharp
answer permalink
3 Comments
  • That didnt really work for me by adding it into the tiapp.xml file. But just using my own manifest file worked. Check out this doc: http://developer.appcelerator.com/doc/mobile/android-custom-androidmanifest

    — commented 2 years ago by garland k

  • For info... it worked for me (SDK 3.0.2) - Thanks Tony.

    — commented 12 months ago by Osian Evans

  • Is there any particular reason it doesn't auto populate this with the version element from tiapp.xml as would be expected? Does anyone know if there are plans for this? It really doesnt make any sense that it doesnt..

    — commented 8 months ago by Joshua Austin

Hey guys, technically there are a hybrid of answers above to make a working solution but it is in-fact possible to just edit the tiapp.xml file.

The initial code of line reads:

<android xmlns:android="http://schemas.android.com/apk/res/android"/>
what you need to replace it with is:
<android xmlns:android="http://schemas.android.com/apk/res/android">
   <manifest android:versionCode="101" android:versionName="1.0.1"/>
</android>
versionCode must be an integer and versionName should be a float or integer.

I solved it :)

Just create a folder called "platform" and within a folder called "android" in your project folder (together with other folders like build, resources etc.). And copy the "AndroidManifest.xml" file from the build\android folder in there and modify the versioncode to 2,3,4,5,6,7 etc. and version name to 1.1, 1.2, 1.3 etc.

Best regards, Darius

using mobile sdk 1.7.2 and even when I set both android:versionCode and android:versionName -- the displayed versions is ALWAYS "1"

— answered 3 years ago by Brian Dittmer
answer permalink
1 Comment
  • Was this ever solved? I'm having the exact same problem where the version code always reverts back to 1.

    — commented 3 years ago by Eve Andersson

what's the proper location/syntax for these declarations in the tiapp.xml?

currently I have them inside of the <android> tag

<android> android:versionCode="1.1.1" android:versionName="Test" </android>

— answered 3 years ago by Brian Dittmer
answer permalink
3 Comments
  • should have read inside the android tag

    <android>
    android:versionCode="1.1.1" 
    android:versionName="Test"
    <android/>

    — commented 3 years ago by Brian Dittmer

  • so per this closed ticket http://jira.appcelerator.org/browse/TIMOB-315

    I've tried:

    <android >
    <manifest android:versionCode="1.1.1" android:versionName="Robo"/>
    <android/>
    But it generates this error during the build - [ERROR] F:\Titanium Studio Workspace\ServiceTest\build\android\AndroidManifest.xml:1: error: Error: String types not allowed (at 'versionCode' with value '1.1.1').

    — commented 3 years ago by Brian Dittmer

  • ok...got it....after reading http://developer.android.com/guide/topics/manifest/manifest-element.html

    versionCode has to be an integer (and this is what your app is known by)

    VersionName is what the user sees when they look at version in settings etc

    — commented 3 years ago by Brian Dittmer

Your Answer

Think you can help? Login to answer this question!