-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
Description
Tool name: Android SDK Manager
What is the tool used for?
Required for Gradle dependency resolution on Android projects in Mend's scanner Docker images. The Android Gradle Plugin adds android.jar from the SDK platform to compile classpaths. Without it, Gradle dependency resolution fails on test compile classpath configurations (*TestCompileClasspath).
Tool scope: Full development stack (headers, SDK, compiler)
Supported version range:
- The latest version is downloadable via https://dl.google.com/android/repository/commandlinetools-linux-latest.zip
- Via, there is https://dl.google.com/android/repository/repository2-1.xml which could be used to download the
cmdline-toolsfor the given major versions
Key commands that must work:
sdkmanager --version
sdkmanager --list
sdkmanager "platforms;android-34"
yes | sdkmanager --licensesUninstall strategy:
rm -rf $ANDROID_HOME
unset ANDROID_HOMELicense: Apache-2.0
Minimal Dockerfile snippet:
RUN apt-get update && apt-get install -y wget unzip \
&& mkdir -p /opt/android-sdk/cmdline-tools \
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-latest.zip -O /tmp/cmdline-tools.zip \
&& unzip -q /tmp/cmdline-tools.zip -d /opt/android-sdk/cmdline-tools \
&& mv /opt/android-sdk/cmdline-tools/cmdline-tools /opt/android-sdk/cmdline-tools/latest \
&& rm /tmp/cmdline-tools.zip
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
RUN yes | sdkmanager --licenses \
&& sdkmanager "platforms;android-33" "platforms;android-34" "platforms;android-35"Suggested tests:
# Test 1 - SDK manager available
sdkmanager --version
# Test 2 - Platform installed
test -f $ANDROID_HOME/platforms/android-34/android.jar
# Test 3 - License accepted
sdkmanager --licenses 2>&1 | grep -q "All SDK package licenses accepted"Any other relevant information:
- Android SDK requires Java (already supported as a parent tool in containerbase)
- The main artifact needed is
android.jarfrom SDK platforms, used by Android Gradle Plugin during dependency resolution
Reactions are currently unavailable