jamesmontemagno / vsts-mobile-tasks

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

Not working for android #37

Closed tyagirajnish closed 2 years ago

tyagirajnish commented 4 years ago

In logs its updating the bundle and version version but when i check after build it remain same For package name

Original manifest:<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sqisland.android.hello"
    android:versionCode="1"
    android:versionName="1.0">
  <application
      android:label="@string/app_name">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
  </application>
</manifest>
true
Old package: com.sqisland.android.hello
New package: com.company.app
true
Old appLabel: @string/app_name
New appLabel: snap-devops
Final manifest: <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app" android:versionCode="1" android:versionName="1.0">
    <application android:label="snap-devops">
        <activity android:name=".MainActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
        </activity>
    </application>
</manifest>

for version number

(i) Provided manifest path:/home/vsts/work/1/s/app/src/main/AndroidManifest.xml
 (i) Version Name (shortcode): 1.0.532
 (i) Using timestamp for the version code. 
 (i) Current time: 1595220790875 | Timestamp: 1595220790
 (i) versionCode: 1595220790
Original manifest:<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app" android:versionCode="1" android:versionName="1.0">
    <application android:label="snap-devops">
        <activity android:name=".MainActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
true
Old versionCode: 1
New versionCode: 1595220790
true
Old versionName: 1.0
New versionName: 1.0.532
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
Final manifest: <?xml version="1.0" encoding="utf-8"?>
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.company.app" android:versionCode="1595220790" android:versionName="1.0.532">
    <application android:label="snap-devops">
        <activity android:name=".MainActivity" android:label="@string/app_name">
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2668) Warning: Use Cipheriv for counter mode of aes-256-ctr
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
Task done!

yml file

  - stage: A
    displayName: set_version
    jobs:
    - job: set_version
      steps:
       - task: android-manifest-package-name@1
         inputs:
           sourcePath: 'app/src/main/AndroidManifest.xml'
           packageName: 'com.company.app'
           appLabel: 'snap-devops'
           printFile: true
       - task: android-manifest-version@1
         inputs:
           sourcePath: 'app/src/main/AndroidManifest.xml'
           versionCodeOption: 'timestamp'
           printFile: true

  - stage:
    displayName: run_gradle
    condition: succeeded('A')
    jobs:
      - job: run_gradle
        steps:
          - task: Gradle@2
            inputs:
              workingDirectory: ''
              gradleWrapperFile: 'gradlew'
              gradleOptions: '-Xmx3072m'
              javaHomeOption: 'JDKVersion'
              jdkVersionOption: '1.8'
              jdkArchitectureOption: 'x64'
              publishJUnitResults: true
              testResultsFiles: '**/TEST-*.xml'
              tasks: 'assembleRelease'
          - task: CopyFiles@2
            inputs:
              contents: '**/*.apk'
              targetFolder: '$(build.artifactStagingDirectory)'
          - task: PublishBuildArtifacts@1
            inputs:
              pathToPublish: '$(build.artifactStagingDirectory)/app/build/outputs/'
              artifactName: 'apk-files'
              artifactType: 'container'
tyagirajnish commented 4 years ago

its working fine now, i just defined version name, package name and gradle build in single stage and its start working :) my question is right now related to android-manifest-package-name@1, this will change the apk file name or what ? because currently my apk is created with aap-unsigned.apk

mcrobbj-abrdn commented 2 years ago

How about closing this if its fixed