android-emulator-runner icon indicating copy to clipboard operation
android-emulator-runner copied to clipboard

Warning - Platform tools already installed

Open mattjohnsonpint opened this issue 3 years ago • 9 comments

I'm seeing this in my runner logs:

Install Android SDK
  /bin/sh -c \yes | sdkmanager --licenses > /dev/null
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Installing latest build tools, platform tools, and platform.
  /bin/sh -c \sdkmanager --install 'build-tools;33.0.0' platform-tools 'platforms;android-31' > /dev/null
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Installing latest emulator.
  /bin/sh -c \sdkmanager --install emulator --channel=0 > /dev/null
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Installing system images.
  /bin/sh -c \sdkmanager --install 'system-images;android-31;google_apis;x86_64' --channel=0 > /dev/null
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'
  Warning: Observed package id 'platform-tools' in inconsistent location '/Users/runner/Library/Android/sdk/platform-tools-2' (Expected '/Users/runner/Library/Android/sdk/platform-tools')
  Warning: Already observed package id 'platform-tools' in '/Users/runner/Library/Android/sdk/platform-tools'. Skipping duplicate at '/Users/runner/Library/Android/sdk/platform-tools-2'

Indeed it would appear everything that is trying to be installed is already on the runner image https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#android

Is there a reason we're trying to install them again? Or is there a way to skip this? Thanks.

mattjohnsonpint avatar Sep 08 '22 20:09 mattjohnsonpint

Maybe similar error

   /usr/bin/sh -c \sudo chown $USER:$USER /usr/local/lib/android/sdk -R
  /usr/bin/sh -c \yes | sdkmanager --licenses > /dev/null
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Installing latest build tools, platform tools, and platform.
  /usr/bin/sh -c \sdkmanager --install 'build-tools;33.0.0' platform-tools 'platforms;android-30' > /dev/null
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Installing latest emulator.
  /usr/bin/sh -c \sdkmanager --install emulator --channel=0 > /dev/null
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Installing system images.
  /usr/bin/sh -c \sdkmanager --install 'system-images;android-30;android-wear;x86' --channel=0 > /dev/null
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')
  Warning: Observed package id 'ndk;23.2.8568313' in inconsistent location '/usr/local/lib/android/sdk/ndk-bundle' (Expected '/usr/local/lib/android/sdk/ndk/23.2.8568313')

From https://github.com/yschimke/rememberwear/actions/runs/3078664216/jobs/4979543909#step:5:15

yschimke avatar Sep 19 '22 09:09 yschimke

Can you post your .yml? @mattjohnsonpint Also, I don't know if we can assume the tools are installed on every flavor of runner.

mrk-han avatar Oct 18 '22 19:10 mrk-han

Can you post your .yml?

Sure. https://github.com/getsentry/sentry-dotnet/blob/main/.github/workflows/device-tests.yml

Also, I don't know if we can assume the tools are installed on every flavor of runner.

The runner images and their pre-installed software are listed here: https://github.com/actions/runner-images/blob/main/README.md

mattjohnsonpint avatar Oct 18 '22 21:10 mattjohnsonpint

@ychescale9 Any downsides to putting a check in before installing the tooling? Suppose we could do that.

Runners already have the SDK tools needed and many people already run the setup-android action before their tests as well.

mrk-han avatar Oct 19 '22 20:10 mrk-han

I can't recall exactly why I did this but it could be something to do with the paths of the preinstalled SDK and the way we install all the tools via the cmdline-tools.

Happy to accept a PR if anyone wants to have a go 😀

ychescale9 avatar Oct 19 '22 21:10 ychescale9

I'm also seeing this output on GH Actions using macos-11

AdamTyler avatar Nov 02 '22 17:11 AdamTyler

Seems like depending on the Java Version the app under test is using, they will need to use either $ANDROID_HOME/tools/ or $ANDROID_HOME/cmdline-tools

So, for this PR we will want to have 2 workflows to test, one with Java 1.8 and one on a higher level, and make sure the appropriate tools are called in both cases.

I'm fairly sure the Github Standard Runners come with sufficient android tooling out of the box, but we can confirm this in the PR.

mrk-han avatar Nov 02 '22 18:11 mrk-han

Note: I did find a discrepancy in the tooling as noted here: https://github.com/ReactiveCircus/android-emulator-runner/discussions/286#discussioncomment-4032351

mrk-han avatar Nov 02 '22 18:11 mrk-han

In our setup, sdkmanager --install system-images;android-26;default;x86_64' alone takes 53 seconds. Is this something that can be reduced?

JoseAlcerreca avatar Nov 07 '23 15:11 JoseAlcerreca