Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Publish an application Upgrade on Android Market not work

Hello,

I have already published a titanium application on Android Market and i try right now to upgrade it on market but the version of the application is always the same (1) in Android Manifest.xml whereas i change it to 1.1 and rebuild the apk with titanium… It's like the application version is hard coded in the AndroidManifest with "1".

Please is there a patch somewhere or someone to explain me how to change it ?

Thank you by advance.

Thomas

— asked April 26th 2010 by Thomas BERNARD
  • android
  • market
  • upgrade
  • version
0 Comments

4 Answers

  • Accepted Answer

    Go to your YourApp/build/android/ folder.
    Make a copy of your AndroidManifest.xml.
    Rename it to AndroidManifest.custom.xml.

    Change following lines:
    android:versionCode="1"
    android:versionName="1"

    to: android:versionCode="2" // A number higher than the one above
    android:versionName="1.1" // Version number to show

    Leave both files and recompile and zipalign.
    This works with me.

    — answered April 27th 2010 by Marco Huppertz
    permalink
    4 Comments
    • I have set versionName and versionNumber higher in new apk compare to my previous apk in AndroidManifest and AndroidManifest.custom file.Now version is gets higher compare to previous version but on device i have to first uninstall my previous apk [lower version] and then install new apk [higher version] then its work like charm.So my question is that 'On each time i have to uninstall my previous apk??' Please help me out.

      — commented November 19th 2011 by rajveer singh
    • When is this functionality going to be added to Titanium automatically?

      The compiler mentions in the console log that custom manifest is deprecated.

      Or is it possible to accomplish the same with the tiapp.xml in the Android manifest section (I've seen examples where entries are added to the manifest, but the version number and name are attributes of the manifest element itself)

      — commented November 23rd 2011 by Michael Janus
    • see this post for how to do it in Titanium Studio

      http://developer.appcelerator.com/question/123781/can-not-increase-the-version-number-for-the-andriod-app#215538

      — commented February 10th 2012 by George K
    • Hi first I thought it was not working. but one thing I think this comment does not make clear is that you must name the file AndroidManifest.custom.xml and that THAT is the file you must edit, not AndroidManifest.xml.
      Also when it says recomplie and zipaling, you can just click again on the Distribute Package Icon(assuming you have configured a distribution already) and that will do it.

      Just thought it would help other people with the same problem

      Also, before I tried this, I tried editing the my tiapp.xml to something llike this;

      <android xmlns:android="http://schemas.android.com/apk/res/android">
      <manifest android:versionCode="2" android:versionName="0.1.1"/>
      </android>

      which does create a manifest with a newer versionCode but then the Google Play store rejects my apk.
      This is the only method that worked for me.

      — commented December 13th 2012 by Usmar Padow
  • why does TI this not automatically?

    — answered August 20th 2011 by Patrick Bröckers
    permalink
    0 Comments
  • Thank you very much for your answer i use it to update my application and it's works well.

    Anyhow i modified the file mobilesdk/[os]/[version]/android/builder.py and add the following lines to do it automatically:

    # Titanium native code here...
    manifest_contents = manifest_contents.replace('<!-- TI_PERMISSIONS -->',permissions_required_xml)
    manifest_contents = manifest_contents.replace('<uses-sdk android:minSdkVersion="4" />', '<uses-sdk android:minSdkVersion="%s" />' % android_sdk_version)
    
    # Custom code to manage version
    match_version = re.search('android:versionCode="(d)"', manifest_contents)
    version_code = None
    if match_version != None:
            version_code = int(match_version.group(1))+1
    
    print("VersionCode=%s" % version_code)
    print("VersionName=%s" % tiapp.properties['version'])
    
    manifest_contents = manifest_contents.replace('android:versionCode="1"', 'android:versionCode="%s"' % str(version_code))
    manifest_contents = manifest_contents.replace('android:versionName="1"', 'android:versionName="%s"' % tiapp.properties['version'])
    

    If it can help someone.

    Thomas

    — answered April 27th 2010 by Thomas BERNARD
    permalink
    0 Comments
  • I have set versionName and versionNumber higher in new apk compare to my previous apk in AndroidManifest and AndroidManifest.custom file.Now version is gets higher compare to previous version but on device i have to first uninstall my previous apk [lower version] and then install new apk [higher version] then its work like charm.So my question is that 'On each time i have to uninstall my previous apk??' Please help me out.

    — answered November 19th 2011 by rajveer singh
    permalink
    1 Comment
    • I got past the versioning problem but ran into this <<The apk must be signed with the same certificates as the previous version.>> I have run keytool and I only have one keystore certificate. So what's the work-around ?

      — commented January 4th 2012 by John Mohan
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.