Bug 51145 - Bogus Version Number Assigned if Field is left unfilled
Summary: Bogus Version Number Assigned if Field is left unfilled
Status: RESOLVED DUPLICATE of bug 51620
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.4
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2016-12-29 14:50 UTC by Andrew Page
Modified: 2017-07-12 22:42 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
How the number ends up in the play store (86.40 KB, image/png)
2016-12-29 14:50 UTC, Andrew Page
Details
attempting to set the version code higher the the bogus on part1 (15.02 KB, image/png)
2016-12-29 14:51 UTC, Andrew Page
Details
attempting to set the version code higher the the bogus on part2 (36.37 KB, image/png)
2016-12-29 14:51 UTC, Andrew Page
Details
When Version Code is removed (180.23 KB, image/png)
2016-12-31 00:21 UTC, Andrew Page
Details
Result if you try to get the version code to 262146 or higher (19.42 KB, image/png)
2016-12-31 00:23 UTC, Andrew Page
Details

Description Andrew Page 2016-12-29 14:50:43 UTC
Created attachment 19028 [details]
How the number ends up in the play store

If you leave the version number unfilled/unset in the AndroidManifest.xml Xamarin Studio or the google api ends up what appears to be a 'garbage' number to it(see attached screenshot).   After that you can't undo that by just boosting the number above the bogus versions as Xamarin Studio won't let you set a number higher than 64k(see attached screenshot)

I suspect a piece of code like this:

int versionNumber ;
if( strlen(versionNumberStr) > 0 )
   versionNumber = atoi(versionNumberStr) ;

or some similar path
Comment 1 Andrew Page 2016-12-29 14:51:20 UTC
Created attachment 19029 [details]
attempting to set the version code higher the the bogus on part1
Comment 2 Andrew Page 2016-12-29 14:51:47 UTC
Created attachment 19030 [details]
attempting to set the version code higher the the bogus on part2
Comment 3 Andrew Page 2016-12-31 00:21:58 UTC
Created attachment 19045 [details]
When Version Code is removed

curiously those numbers come out to be 0x40001 and 0x20001.   Do they get generated if the android:versionCode is absent?
Comment 4 Andrew Page 2016-12-31 00:23:43 UTC
Created attachment 19046 [details]
Result if you try to get the version code to 262146 or higher

So... it's catch22.  I can't delete the beta version from the google play store and I can't set the number higher than 64k.
Comment 5 dean.ellis 2017-06-15 09:02:22 UTC
This is probably related to the following code

https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs#L841

It used to be that the max versionCode was 65535, bit it seems google has now upped that

" Warning: The greatest value Google Play allows for versionCode is 2100000000."

from the docs at [1]


Note this cod path is used when emitting an apk per abi. See [2]


[1] https://developer.android.com/studio/publish/versioning.html
[2] https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs#L821
Comment 6 Cody Beyer (MSFT) 2017-07-12 22:42:18 UTC

*** This bug has been marked as a duplicate of bug 51620 ***

Note You need to log in before you can comment on or make changes to this bug.