Search code examples
androidcordovaextjssencha-cmd

android version Code android version name cordova


After changes to my code i trying to update my android application version build with cordova. In AndroidManifest.xml i changes the android:versionName to higher number like "1.2.9" to "1.2.10" also and the android:versionCode at same file. after build using cordova these two numbers change automatically. i tried to add the android:versionName at config.xml file but after cordova build the same thing is happening and during the build i am getting error

FAILURE: Build failed with an exception.
  • What went wrong: Execution failed for task ':processReleaseResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

any idea how to solve this problem?


Solution

  • To set the version-code and version-name for android you have to add android-versionCode="" and version="" to the <widget> tag in config.xml as following example shows:

    <widget android-versionCode="100" version="1.0.0" ... >
    

    You should never modify anything in the platforms folder directly as it get recreated when you prepare/build/readd the platform.