When the "Generate one package per selected ABI" feature is enabled, high numerical values for versionCode ("Version number" in the build options page) cause the build process to fail.
The error produced during build is:
> "Error executing task Aapt: VersionCode is outside 0, 65535 interval" in Xamarin.Android.Common.targets
Disabling the APK per ABI feature works around the problem, but obviously you end up with a single bloated APK that way.
NOTE: There is guidance for using scripts to control the multi-APK build process (here: https://developer.xamarin.com/guides/android/advanced_topics/build-abi-specific-apks/#Creating_the_Version_Code_for_the_APK), but the options UI does not hint at this being a requirement or suggested approach, and the article does not provide a full solution - it leaves the actual script writing/debugging up to the reader.
Created attachment 23094 [details]
Sample Xamarin.Android project with android:versionCode set to 65536.
Steps to duplicate:
1. Open the attached solution.
2. Check the Projection options of the Xamarin.Android project - note that the android:versionCode is set to 65536 and that the APK per ABI is checked. Also note that multiple ABIs are selected.
3. Try to build the Application, the build will fail with the specified error.
4. Go back to the Project Options for the Xamarin.Android project, under Build > Android Build > General, unselect the "On ABI per APK".
5. Try and build the Application, the build will fail with the same error.
Multiple APIs would be created with the specified version code.
Looking at the docs 65535 is no longer the max value for the version code.
It is 2100000000 so our code needs to be updated to allow this.