Forum Xamarin.Android


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

aapt.exe - VersionCode too high?


I've just updated Xamarin for Visual Studio (Xamarin and Xamarin.Android according to About dialog), and my project no longer builds.

I get the message: Invalid command line switch for "aapt.exe". VersionCode is outside 0, 65535 interval

Indeed, my version code is 220622, but that was always okay and all the documentation I can find online say that version code is a 32-bit integer and has a maximum of something like 2000000. There should be no problem with this value, but suddenly it's not okay any more. Obviously decreasing the value isn't an option, because then Android will refuse to see newer releases an an upgrade over existing installed versions.

"aapt.exe" in this case is "SDK\build-tools\23.0.0\aapt.exe" if that helps at all.

Can anybody explain what's happening here, and help me resolve it? I'll just set the version to 1 for now so I can debug, but I need to resolve this before I can publish a new release...



  • I've managed to stop this happening by unchecking 'Generate one package (.apk) per selected ABI'. I tried various combinations of options and target SDK versions, but this option is the only thing that seems to make a difference. When unchecked, I don't get the error.

    I assume this is a bug in the build process? Is there somewhere I should report this?

  • zmp2000zmp2000 BRMember

    I´m also, experiencing this problem!
    And I need to mark Generate One Package (.apk) per Selected ABI!

    He generates apk with random Version Codes

Sign In or Register to comment.