jamesmontemagno / vsts-mobile-tasks

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

problem with version number too high with a two in front of it #36

Closed nexxuno closed 4 years ago

nexxuno commented 4 years ago

Here is the error:

[error]VideoProcessorBMap\VideoProcessorBMap.Android\obj\Release\90\android\AndroidManifest.xml(0,0): Error XA0003: Invalid `android:versionCode` value `21593974274` in `AndroidManifest.xml`. It must be an integer value.

But the actual task only does this:

 (i) Provided manifest path:d:\a\1\s\VideoProcessorBMap\VideoProcessorBMap.Android\Properties\AndroidManifest.xml
 (i) Version Name (shortcode): 0.0.509
 (i) Using Custom Defined Version Code and adjusting for offset if needed.
 (i) versionCodeOffset: 1593973766
 (i) versionCode: 1593974275
Original manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.beltmap.videoprocessorbmaptwo" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
    <application android:label="Mask Detector by Beltmap" android:icon="@drawable/icon"></application>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>

true
Old versionCode: 1
New versionCode: 1593974275
true
Old versionName: 1.0
New versionName: 0.0.509
Final manifest: 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1593974275" android:versionName="0.0.509" package="com.beltmap.videoprocessorbmaptwo" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
    <application android:label="Mask Detector by Beltmap" android:icon="@drawable/icon" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>

Task done!
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:5488) Warning: Use Cipheriv for counter mode of aes-256-ctr

There is a 2 in front of the code that makes it go out of range.

jamesmontemagno commented 4 years ago

So, versionCode — A positive integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions.

https://developer.android.com/studio/publish/versioning

The greatest possible value for android:versionCode is MAXINT (2147483647). However, if you upload an app with this value, your app can't ever be updated.

nexxuno commented 4 years ago

Hello @jamesmontemagno , I know that, but the new version code your extension is setting is 1593974275 (10 digits) in theory which is in range. I don't know where that 11 digit number is coming from (note that it's almost the same number with a 2 in front of it). It was working till yesterday.

jamesmontemagno commented 4 years ago

I'm not sure because android:versionCode="1593974275" android:versionName="0.0.509" is what it says.... so looks like the script worked...

jamesmontemagno commented 4 years ago

https://forums.xamarin.com/discussion/112717/the-aapt-task-failed-unexpectedly-versioncode-is-invalid are you splitting your apk? dont' do that and use app bundle if you can.

nexxuno commented 4 years ago

you are right, sorry for the issue here