Home > Software engineering >  Azure Devops pipeline for Android - failed to find target with hash string 'android-23
Azure Devops pipeline for Android - failed to find target with hash string 'android-23

Time:03-23

I am onboarding a project to Azure devops. I get the error shown in the image attached. I get this during assembledebug stage. I understand this might be due to the fact that Android 23 is not present in the Agent. How do I overcome this issue and successfully do the build. I have done research for quite some time with no luck.

trigger:
- master

pool:
  vmImage: 'macos-latest'

steps:
- task: Gradle@2
  inputs:
    workingDirectory: ''
    gradleWrapperFile: 'gradlew'
    gradleOptions: '-Xmx3072m'
    publishJUnitResults: false
    testResultsFi[![enter image description here][1]][1]les: '**/TEST-*.xml'
    tasks: 'assembleDebug'

enter image description here

CodePudding user response:

Refer to this doc about Microsoft-hosted MacOs agnet: macOS 11.6 info.

Currently macOs agent does not have android-23 pre-installed. So it could cause the issue.

To solve this issue, you need to install the android-23 in command line.

For example:

- bash: '$ANDROID_HOME/tools/bin/sdkmanager --install "platforms;android-23" "sources;android-23"'
  displayName: 'Bash Script'

You can add the step before the Gradle task.

  • Related