jamesmontemagno / vsts-mobile-tasks

VSTS Tasks for Mobile!
MIT License
79 stars 22 forks source link

0 version code write empty string in AndroidManifest.xml #21

Closed ghost closed 5 years ago

ghost commented 5 years ago

First thank you for your useful task. It saves a lot of time.

I noticed a 0 versionCode results in an empty string written in the AndroidManifest.xml. This causes the build to fail because empty string are not allowed for versionCode.

jamesmontemagno commented 5 years ago

Can you share your settings you are using and what you are seeing....

The before and after would be very helpful.

ghost commented 5 years ago

Hello

Sure

Here are the settings

build settings

The Build task output build task output

The bump task output bump task output

Please let me know if you need further information

jamesmontemagno commented 5 years ago

What is your $(BuildNumber) ? It must be an integer. By default it is not.

ghost commented 5 years ago

By default it is not.

What do you mean ? BuildNumber is a pipeline variable.

jamesmontemagno commented 5 years ago

The default for the BuildNumber is a string, not an integer... it is like 20190123.45 or something.

You either want to use: $(Build.BuildId) or go to your Options and change your Build Number Format to be an integer that increases :) That will fix it up.

ghost commented 5 years ago

Nope. BuildNumber is a custom variable that I have defined as a Pipeline variable. There is a confusion between it and the standard Build.BuildNumber variable. BuildNumber is, in my case an internal build number.
The issue persists, so.

jamesmontemagno commented 5 years ago

Can you print out the number somewhere? What is it set to?

jamesmontemagno commented 5 years ago

here is what I have: image

Settings: image

Output: image

ghost commented 5 years ago

Hi James, I have exactly the same input/output as you excepted that I set my BuildNumber value to 0. My build does not work but this is because a zero value is not allowed for versionCode in android. Since a 0 build number is allowed in iOS, I messed up myself. Nothing to do with your (awesome) task, so. Thanks for your help and sorry for your time.

jamesmontemagno commented 5 years ago

no worries :0 glad you got it working