Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android SDK Build Tools doesn't exists on macOS runners on default #10814

Open
9 of 15 tasks
mcagabe19 opened this issue Oct 18, 2024 · 14 comments
Open
9 of 15 tasks

Android SDK Build Tools doesn't exists on macOS runners on default #10814

mcagabe19 opened this issue Oct 18, 2024 · 14 comments
Assignees
Labels
Area: Android awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report bug Something isn't working OS: macOS

Comments

@mcagabe19
Copy link

mcagabe19 commented Oct 18, 2024

Description

title and I use ANDROID_HOME env btw

(sorry if something is wrong, I'm first time making issue to here)

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Version: 20241014.193
Link to build: https://github.com/MobilePorting/FPS-Plus-Mobile/actions/runs/11408800443/job/31747750013

Is it regression?

uhhh no ig?

Expected behavior

To Build

Actual behavior

build-tools is missing or misplaced, idk really

Repro steps

  1. Set sdk path to lime
  2. Run a build
  3. Getting build-tools missing
@mcagabe19
Copy link
Author

mcagabe19 commented Oct 19, 2024

after some digging and using find on $ANDROID_HOME, I can confirm it's really not there and don't get confused with tools folder, it's not really build-tools

@sarathrajsrinivasan
Copy link
Contributor

Hi @mcagabe19 ,

We are looking into it. Will keep you posted.

@vaishalipawar1490 vaishalipawar1490 self-assigned this Oct 22, 2024
@sarathrajsrinivasan
Copy link
Contributor

Hi @mcagabe19 ,

We are able to see the Android SDK Build tools in all macOS12, macOS13 and macOS14 images.

We are investigating for macOS15. In the meantime please check your workflow with either macOS13 or macOS14.

    steps: 
    - name: Check Android SDK Build tools
      run: |
        echo "ANDROID_HOME is set to: $ANDROID_HOME"
        echo "Contents of Users/runner/Library/Android/sdk/build-tools/"
        ls -ltr /Users/runner/Library/Android/sdk/build-tools/

@sarathrajsrinivasan sarathrajsrinivasan self-assigned this Oct 23, 2024
@mcagabe19
Copy link
Author

mcagabe19 commented Oct 23, 2024

on a test workflow, indeed macOS 12, 13 and 14 does have
https://github.com/mcagabe19/v/actions/runs/11476806865

so that means only macOS 15 doesn't have

@qwertylolman
Copy link

finally, I found this ticket xD

any workarounds? it's critical for us, and PR is still not approved

@mcagabe19
Copy link
Author

mcagabe19 commented Oct 28, 2024

finally, I found this ticket xD

any workarounds? it's critical for us, and PR is still not approved

https://github.com/MobilePorting/FNF-PsychEngine-Mobile/blob/6d805893ffdb391be5dbaa1f3dae717463d258a4/.github/workflows/build.yml#L43-L51

@sven-s
Copy link

sven-s commented Nov 7, 2024

The build-tools are not on macos-15. I need it for my maui project, since i got this error:

/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.143/targets/Microsoft.Android.Sdk.Tooling.targets(31,5): error XA5205: Cannot find aapt. Please install the Android SDK Build-Tools package with the /Users/runner/Library/Android/sdk/tools/android program. [/Users/runner/work/1/s/cpm-app/cpm-app.csproj::TargetFramework=net8.0-android]

Please make the build-tools available. Thanks!

@visualspark
Copy link

The build-tools are not on macos-15. I need it for my maui project, since i got this error:

/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.143/targets/Microsoft.Android.Sdk.Tooling.targets(31,5): error XA5205: Cannot find aapt. Please install the Android SDK Build-Tools package with the /Users/runner/Library/Android/sdk/tools/android program. [/Users/runner/work/1/s/cpm-app/cpm-app.csproj::TargetFramework=net8.0-android]

Please make the buidl-tools available. Thanks!

Same with me, since upgrading to macos-15 to compile my maui ios project with xcode 16, my android tasks are failing.

All projects are up-to-date for restore.
/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.Android.Sdk.Darwin/34.0.145/targets/Microsoft.Android.Sdk.Tooling.targets(31,5): error XA5205: Cannot find `aapt`. Please install the Android SDK Build-Tools package with the `/Users/runner/Library/Android/sdk/tools/android` program. [/Users/runner/work/1/s/App/App.csproj::TargetFramework=net8.0-android]

@mcagabe19
Copy link
Author

finally, I found this ticket xD
any workarounds? it's critical for us, and PR is still not approved

https://github.com/MobilePorting/FNF-PsychEngine-Mobile/blob/6d805893ffdb391be5dbaa1f3dae717463d258a4/.github/workflows/build.yml#L43-L51

I guess this workaround still gonna apply for a while

@d-philipson
Copy link

After a breakage in the MAUI workloads a few weeks ago everyone was advised to migrate to macOS-14 and Xcode 16. Now the rug has been pulled by removing Xcode 16 from macOS-14 and breaking lots of peoples build pipelines in the process. Any word on when the Android build tools will be added to macOS-15?

@mcagabe19
Copy link
Author

whenever this pull request is merged, it'll be fixed I think
#10912

@spelletier
Copy link

I managed to get my Azure Devon pipelines to complete by adding a script task after the MAUI install. Replace $(AndroidProjectPath) with your own path to the Android project.

    - script: |
          dotnet workload install maui
      displayName: 'Install MAUI workload'

    - script: |
          yes | /Users/runner/Library/Android/sdk/tools/bin/sdkmanager --licenses
          dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=/Users/runner/Library/Android/sdk"
      workingDirectory: $(AndroidProjectPath)
      displayName: 'Install Android sdk dependencies'

@TomSoPolaris
Copy link

I was able to work around this but had to add these 3 tasks after the step to install the MAUI workloads. We're building our .NET MAUI app with Android 14 as the target version (API level 34).

# Workaround for Android build tools not being available on macos-15 agents: https://github.com/actions/runner-images/issues/10814
- task: Bash@3
  displayName: 'Workaround build-tools issue'
  inputs:
    targetType: 'inline'
    script: |
      curl https://dl.google.com/android/repository/build-tools_r35_macosx.zip > $ANDROID_HOME/build-tools_r35_macosx.zip
      cd $ANDROID_HOME
      mkdir build-tools
      unzip build-tools_r35_macosx.zip
      mv android-15 build-tools/35.0.0

# Workaround. Need to install sdkmanager first. sdkmanager is required for installing the Android SDK platform
- task: Bash@3
  displayName: 'Install Android SDK Command-line Tools'
  inputs:
    targetType: 'inline'
    script: |
      echo "Installing Android SDK Command-line Tools..."
      mkdir -p $ANDROID_HOME/cmdline-tools
      curl -o commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-mac-7583922_latest.zip
      unzip commandlinetools.zip -d $ANDROID_HOME/cmdline-tools
      mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
      export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
      yes | sdkmanager --licenses
      yes | sdkmanager "platforms;android-34"


# Workaround for macos-15 error: Could not find android.jar for API level 34. This means the Android SDK platform for API level 34 is not installed
- task: Bash@3
  displayName: 'Install Android SDK for API level 34'
  inputs:
    targetType: 'inline'
    script: |
      echo "Setting up Android SDK environment variables..."
      export ANDROID_HOME=$HOME/Library/Android/sdk
      export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools

      echo "Installing Android SDK components..."
      yes | sdkmanager "platforms;android-34"

@erik-bershel erik-bershel added Area: Android awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug Something isn't working labels Nov 19, 2024
@mcagabe19
Copy link
Author

now build-tools does exists but there's nothing on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Android awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report bug Something isn't working OS: macOS
Projects
None yet
Development

No branches or pull requests

10 participants