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

Warning - Platform tools already installed #265

Open
mattjohnsonpint opened this issue Sep 8, 2022 · 9 comments
Open

Warning - Platform tools already installed #265

mattjohnsonpint opened this issue Sep 8, 2022 · 9 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mattjohnsonpint
Copy link
Contributor

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.

@yschimke
Copy link

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

@mrk-han
Copy link
Collaborator

mrk-han commented Oct 18, 2022

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

@mattjohnsonpint
Copy link
Contributor Author

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

@mrk-han
Copy link
Collaborator

mrk-han commented Oct 19, 2022

@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 mrk-han added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 19, 2022
@ychescale9
Copy link
Member

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 😀

@AdamTyler
Copy link

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

@mrk-han
Copy link
Collaborator

mrk-han commented Nov 2, 2022

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
Copy link
Collaborator

mrk-han commented Nov 2, 2022

Note: I did find a discrepancy in the tooling as noted here: #286 (comment)

@JoseAlcerreca
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants