As of Titanium 9.0.0, setting the "versionCode" via the "AndroidManifest.xml" file no longer works.
(This regression was caught before release.)
Steps to reproduce:
- Create a Titanium app project.
- Set up the "tiapp.xml" file with the below.
- Build for Android.
- Go to folder: ./build/android/app/build/intermediates/merged_manifests/debug
- Open the "AndroidManfiest.xml" file.
- Notice android:versionCode attribute is set to "1". (This is the bug.)
When building with gradle, the "versionCode" and "versionName" attributes are ignored in the "AndroidManifest.xml" file. These settings can only be set via a "build.gradle" file. This is by Google's design.
Titanium's build script should read the "versionCode" from the app developer's "AndroidManifest.xml" write it to the Titanium generated "build.gradle" file. This way it will be backward compatible.
Set the "versionCode" via your own "build.gradle" file as shown below.