FROM gradle:jdk25
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK setup
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
RUN mkdir -p $ANDROID_HOME && \
mkdir -p /opt/android-sdk/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
yes | /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
# Exclude VCS .git # IntelliJ / IDE specific *.iml .idea/ .gradle/ # Build outputs **/build/ **/out/ # NPM / Node node_modules/ # OS files .DS_Store
Concerns: FROM image tag 'gradle:jdk25' is likely invalid/not available; should use a valid tag like 'gradle:latest', 'gradle:jdk17', or a specific Gradle JDK image compatible with Android builds., The build relies on a network-heavy Android SDK setup (downloading commandline tools and SDK components) which may fail in restricted environments or cause slow CI builds., COPY . /workspace and running the wrapper build inside the image assumes the repository structure matches the expected Gradle module path (e.g., DanmakuFlameMaster); if the module path differs, the assembleRelease task may fail., The CMD prints a path to the build outputs but there is no guarantee the build artifacts exist at runtime if the previous build step failed during image build., Potential fragility in using a fixed cmdline-tools URL and path layout; newer Android SDK tool layouts could change, breaking the sdkmanager invocation.
gradle (624 stars): Gradle is a fast, reliable, and flexible open-source build tool with an elegant, bitnami/gradle (14 stars): Bitnami Secure Image for gradle chainguard/gradle (0 stars): Build, ship and run secure software with Chainguard's low-to-zero CVE container okteto/gradle (1 stars): paketobuildpacks/gradle (1 stars): eclipse/ubuntu_jdk8 (17 stars): Ubuntu, JDK8, Maven 3, git, curl, nmap, mc, cbuild circleci/jdk8 (3 stars): This image is for internal use eclipse/ubuntu_gradle (0 stars): Ubuntu, JDK1.8, Gradle2.3 eclipse/centos_jdk8 (7 stars): CentOS, JDK8, Maven 3, git, curl, nmap, mc, cbuild dockette/jdk8 (6 stars): My Oracle Java 8 Dockerfile
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK setup
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
RUN mkdir -p $ANDROID_HOME && \
mkdir -p /opt/android-sdk/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
yes | /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
Summary (under 1500 chars):
- Exact error message and exit code
- /bin/sh: 1: /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager: not found
- exit code: 127
- Failing command/step
- Step [3/6] RUN mkdir -p $ANDROID_HOME && \
mkdir -p /opt/android-sdk/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
yes | /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
- Missing packages/files mentioned
- The file /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager was not found (path missing).
- Version mismatch / layout issue
- The command fails not due to missing packages but because the sdkmanager binary isn’t at the expected path. The commandlinetools ZIP extraction places nested directories (likely /opt/android-sdk/cmdline-tools/cmdline-tools/tools/bin/sdkmanager), so /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager does not exist. This is a packaging/layout mismatch rather than a reported version conflict.FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/cmdline-tools/tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
yes | ${ANDROID_HOME}/cmdline-tools/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
Summary of Docker build error Exact error message and exit code - /bin/sh: 1: /opt/android-sdk/cmdline-tools/cmdline-tools/tools/bin/sdkmanager: not found - Exit code: 127 - The overall step ended with: did not complete successfully: exit code: 127 Failing command/step - Step [3/6] RUN mkdir -p /opt/android-sdk && mkdir -p /opt/android-sdk/cmdline-tools && curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && rm /tmp/commandlinetools.zip && yes | /opt/android-sdk/cmdline-tools/cmdline-tools/tools/bin/sdkmanager --sdk_root=/opt/android-sdk "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669" Missing packages or files mentioned - sdkmanager binary not found at /opt/android-sdk/cmdline-tools/cmdline-tools/tools/bin/sdkmanager - This indicates a path mismatch or an incomplete/unexpected unzip layout for the downloaded commandlinetools ZIP. The expected location of sdkmanager may differ (e.g., /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager or /opt/android-sdk/tools/bin/sdkmanager) depending on the version of commandlinetools. Version mismatch info - Commandline tools ZIP used: commandlinetools-linux-9477386_latest.zip - Requested components: platforms;android-25, build-tools;26.0.2, ndk;21.0.6113669 - No explicit version mismatch is shown; the error is due to the missing sdkmanager binary rather than a component version conflict.
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Attempt to expose sdkmanager at a common path via symlink (covers layout differences)
if [ -f "${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager" ]; then \
ln -sf "${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager" "${ANDROID_HOME}/tools/bin/sdkmanager"; \
elif [ -f "${ANDROID_HOME}/cmdline-tools/bin/sdkmanager" ]; then \
ln -sf "${ANDROID_HOME}/cmdline-tools/bin/sdkmanager" "${ANDROID_HOME}/tools/bin/sdkmanager"; \
fi && \
chmod +x ${ANDROID_HOME}/tools/bin/sdkmanager && \
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
Status - VerifyBuild status: build_failed Concerns - The Dockerfile downloads Android SDK components, making the image large and builds slower; caching or separating Android tooling could speed rebuilds. - sdkmanager path setup relies on the commandline-tools layout; changes could break the symlink logic and chmod step. - Build requires network access to download dependencies; in restricted environments this could fail or be slow. Build error - chmod: cannot access '/opt/android-sdk/tools/bin/sdkmanager': No such file or directory - exit code: 1 - The build then reports: "ERROR: failed to build: failed to solve: process ... did not complete successfully: exit code: 1" Failing command/step - Step [3/6]: RUN mkdir -p /opt/android-sdk && mkdir -p /opt/android-sdk/cmdline-tools && curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && rm /tmp/commandlinetools.zip && if [ -f "/opt/android-sdk/cmdline-tools/tools/bin/sdkmanager" ]; then ln -sf "/opt/android-sdk/cmdline-tools/tools/bin/sdkmanager" "/opt/android-sdk/tools/bin/sdkmanager"; elif [ -f "/opt/android-sdk/cmdline-tools/bin/sdkmanager" ]; then ln -sf "/opt/android-sdk/cmdline-tools/bin/sdkmanager" "/opt/android-sdk/tools/bin/sdkmanager"; fi && chmod +x /opt/android-sdk/tools/bin/sdkmanager && yes | /opt/android-sdk/tools/bin/sdkmanager --sdk_root=/opt/android-sdk "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669" Missing packages or files mentioned - The error indicates the sdkmanager binary is missing at /opt/android-sdk/tools/bin/sdkmanager (No such file or directory). This prevents chmod and the subsequent sdkmanager invocation. - Potentially missing path contents after unzip (the expected tools/bin/sdkmanager is not created at the specified location). Version mismatch information - Android commandlinetools ZIP: commandlinetools-linux-9477386_latest.zip - Requested components to install: platforms;android-25, build-tools;26.0.2, ndk;21.0.6113669 - No explicit version mismatch is reported; the failure is due to the missing sdkmanager binary after extracting.
DanmakuFlameMaster
==================
android上开源弹幕解析绘制引擎项目。[](https://travis-ci.org/Bilibili/DanmakuFlameMaster)
### DFM Inside:
[](https://play.google.com/store/apps/details?id=tv.danmaku.bili)
- libndkbitmap.so(ndk)源码:https://github.com/Bilibili/NativeBitmapFactory
- 开发交流群:314468823 (加入请注明DFM开发交流)
### Features
- 使用多种方式(View/SurfaceView/TextureView)实现高效绘制
- B站xml弹幕格式解析
- 基础弹幕精确还原绘制
- 支持mode7特殊弹幕
- 多核机型优化,高效的预缓存机制
- 支持多种显示效果选项实时切换
- 实时弹幕显示支持
- 换行弹幕支持/运动弹幕支持
- 支持自定义字体
- 支持多种弹幕参数设置
- 支持多种方式的弹幕屏蔽
### TODO:
- 增加OpenGL ES绘制方式
### Download
Download the [latest version][1] or grab via Maven:
```xml
<dependency>
<groupId>com.github.ctiao</groupId>
<artifactId>dfm</artifactId>
<version>0.9.25</version>
</dependency>
```
or Gradle:
```groovy
repositories {
jcenter()
}
dependencies {
compile 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
compile 'com.github.ctiao:ndkbitmap-armv7a:0.9.21'
# Other ABIs: optional
compile 'com.github.ctiao:ndkbitmap-armv5:0.9.21'
compile 'com.github.ctiao:ndkbitmap-x86:0.9.21'
}
```
Snapshots of the development version are available in [Sonatype's snapshots repository][2].
### License
Copyright (C) 2013-2015 Chen Hui <calmer91@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
[1]:https://oss.sonatype.org/#nexus-search;gav~com.github.ctiao~dfm~~~
[2]:https://oss.sonatype.org/content/repositories/snapshots/
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager regardless of layout and create a stable symlink
SDKMANAGER=$(find ${ANDROID_HOME}/cmdline-tools -name sdkmanager | head -n1); \
if [ -n "$SDKMANAGER" ]; then ln -sf "$SDKMANAGER" ${ANDROID_HOME}/tools/bin/sdkmanager; else echo "sdkmanager not found"; exit 1; fi && \
chmod +x ${ANDROID_HOME}/tools/bin/sdkmanager && \
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
- VerifyBuild status: build_failed - Concerns - The build pulls Android SDK components during image build; this can fail or slow CI in restricted networks or if components become unavailable/updated. - Hard-coded Android API level/platforms;android-25 and NDK ndk;21.0.6113669 may become outdated; changes could break the build. - COPY . /workspace copies the entire repository into the image; consider a .dockerignore to avoid large or sensitive files. - No non-root user; build runs as root (security concern for long-running containers). - No multi-stage build; final image may be large due to Android SDK components and Gradle caches. - Build error - Exact error: ln: failed to create symbolic link '/opt/android-sdk/tools/bin/sdkmanager': No such file or directory - Exit code: 1 - Failing command/step - [3/6] RUN mkdir -p /opt/android-sdk && mkdir -p /opt/android-sdk/cmdline-tools && curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && rm /tmp/commandlinetools.zip && SDKMANAGER=$(find /opt/android-sdk/cmdline-tools -name sdkmanager | head -n1); if [ -n "$SDKMANAGER" ]; then ln -sf "$SDKMANAGER" /opt/android-sdk/tools/bin/sdkmanager; else echo "sdkmanager not found"; exit 1; fi && chmod +x /opt/android-sdk/tools/bin/sdkmanager && yes | /opt/android-sdk/tools/bin/sdkmanager --sdk_root=/opt/android-sdk "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669" - Missing packages or files mentioned - The symlink creation fails because the target directory for the link does not exist: '/opt/android-sdk/tools/bin' (no such file or directory). As a result, sdkmanager cannot be linked into that path. - If sdkmanager were not found in the find result, the script would exit with "sdkmanager not found," but the actual failure shown is the ln failure due to the missing directory. - Version info / relevant version - Downloaded commandlinetools zip: commandlinetools-linux-9477386_latest.zip - Requested installations: platforms;android-25, build-tools;26.0.2, ndk;21.0.6113669 - No explicit version mismatch reported; the issue is the missing /opt/android-sdk/tools/bin path preventing sdkmanager from being linked.
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates tzdata && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager and create a stable symlink to a known path
SDKMANAGER=$(find ${ANDROID_HOME}/cmdline-tools -name sdkmanager | head -n1); \
mkdir -p ${ANDROID_HOME}/tools/bin; \
if [ -n "$SDKMANAGER" ]; then ln -sf "$SDKMANAGER" "${ANDROID_HOME}/tools/bin/sdkmanager"; fi; \
if [ -f "${ANDROID_HOME}/tools/bin/sdkmanager" ]; then \
chmod +x ${ANDROID_HOME}/tools/bin/sdkmanager; \
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; \
else \
echo "sdkmanager not found"; exit 1; \
fi
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
- Status: build_failed - Concern summary: Build may fail if Android SDK commandline-tools URL or versions become unavailable; relies on module DanmakuFlameMaster:assembleRelease; image build is heavy and may hit CI timeouts; differences in module/Gradle task will break the image. - Failing step: Step [3/6] RUN - Actions attempted: create /opt/android-sdk and /opt/android-sdk/cmdline-tools; download commandlinetools-linux-9477386_latest.zip from https://dl.google.com/android/repository/commandlinetools-linux_9477386_latest.zip; unzip to /opt/android-sdk/cmdline-tools; locate sdkmanager; create /opt/android-sdk/tools/bin; symlink sdkmanager; chmod +x; run sdkmanager with --sdk_root=/opt/android-sdk to install "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669" - Exit: 1 - Exact error messages and exit code: - Error: A JNI error has occurred, please check your installation and try again - Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 - Exit code: 1 - Missing packages/files: - No explicit missing-file error. sdkmanager binary found at runtime but incompatible with the Java runtime in the base image. - Version mismatch details: - Compiled class version: 55.0 (requires Java 11+) - Runtime supports up to: 52.0 (Java 8) - Base image uses gradle:jdk8 (Java 8), causing JNI/class-version mismatch. - Root cause and fix notes: - The sdkmanager tool is too new for the Java runtime in the base image. - Fix options: upgrade the base image JDK to Java 11+ or use commandlinetools compatible with Java 8. Alternatively, use a Java 11+ JDK in the image or pin older commandlinetools that support Java 8. - Affected module/target: - DanmakuFlameMaster:assembleRelease - URL and binaries involved: - Commandline tools URL: https://dl.google.com/android/repository/commandlinetools-linux_9477386_latest.zip - Android SDK paths: /opt/android-sdk, /opt/android-sdk/cmdline-tools, /opt/android-sdk/tools/bin/sdkmanager - sdkmanager installs: platforms;android-25, build-tools;26.0.2, ndk;21.0.6113669
FROM gradle:jdk11
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates tzdata && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager and create a stable path to it
SDKMANAGER=$(find ${ANDROID_HOME}/cmdline-tools -name sdkmanager | head -n1); \
mkdir -p ${ANDROID_HOME}/tools/bin; \
if [ -n "$SDKMANAGER" ]; then ln -sf "$SDKMANAGER" "${ANDROID_HOME}/tools/bin/sdkmanager"; fi; \
if [ -x "${ANDROID_HOME}/tools/bin/sdkmanager" ]; then \
yes | ${ANDROID_HOME}/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; \
else \
echo "sdkmanager not found"; exit 1; \
fi
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
Summary (under 1500 chars): - Failing command/step: [6/6] RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease - Exact error message and exit code: - Error: Could not determine java version from '11.0.30'. - Exit code: 1 - Missing packages or files mentioned: None explicitly noted as missing (apt-get steps installed curl, unzip, zip, ca-certificates, tzdata; no missing-file errors shown). - Version mismatch info: The failure is due to a Java/Gradle compatibility issue. Gradle wrapper 4.1 cannot determine Java version when using JDK 11 (11.0.30); the Dockerfile uses a gradle:jdk11 image, while the wrapper expects an older Java version. This indicates a Gradle 4.1 and JDK 11 mismatch.
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates tzdata && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager and run to install required components
SDKMANAGER=$(find ${ANDROID_HOME} -name sdkmanager | head -n1); \
if [ -n "$SDKMANAGER" ]; then echo "sdkmanager at $SDKMANAGER"; \
chmod +x "$SDKMANAGER"; \
yes | "$SDKMANAGER" --sdk_root="${ANDROID_HOME}" \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; \
else echo "sdkmanager not found"; exit 1; fi
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
- Build status: build_failed - Failing step: [3/6] RUN mkdir -p /opt/android-sdk && mkdir -p /opt/android-sdk/cmdline-tools && curl -sSL https://dl.google.com/android/repository/commandlinetools-linux_9477386_latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && rm /tmp/commandlinetools.zip && SDKMANAGER=$(find /opt/android-sdk -name sdkmanager | head -n1); if [ -n "$SDKMANAGER" ]; then echo "sdkmanager at $SDKMANAGER"; chmod +x "$SDKMANAGER"; yes | "$SDKMANAGER" --sdk_root="/opt/android-sdk" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; else echo "sdkmanager not found"; exit 1; fi - Exact error message and exit code: Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (exit code: 1) - Missing packages/files mentioned: - sdkmanager was found at /opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager - No explicit “not found” or missing-file messages; the failure is due to a Java version mismatch rather than a missing package/file. - Version mismatch / root cause: - sdkmanager requires Java 11+ (class file version 55.0) but the container base uses JDK 8 (class file versions up to 52.0) - Suggested fixes: - Use a base image with Java 11+ (e.g., gradle:jdk11) or install Java 11+ and set JAVA_HOME so runtime matches sdkmanager - Alternatively, align tooling to Java 8 if available (less common; upgrading Java is the typical approach) - Notes: - The failure occurs after extracting commandlinetools ZIP; sdkmanager path detected as /opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager, but Java version mismatch prevents execution.
FROM gradle:jdk11
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates tzdata && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager and run to install required components
SDKMANAGER=$(find ${ANDROID_HOME} -name sdkmanager | head -n1); \
if [ -n "$SDKMANAGER" ]; then echo "sdkmanager at $SDKMANAGER"; \
chmod +x "$SDKMANAGER"; \
yes | "$SDKMANAGER" --sdk_root="${ANDROID_HOME}" \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; \
else echo "sdkmanager not found"; exit 1; fi
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
Summary (under 1500 chars): - Exact error message and exit code - exit code: 1 - Error: Could not determine java version from '11.0.30'. - Failing command/step - Dockerfile step [6/6]: RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease - Failing command: chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease - Missing packages or files mentioned - No explicit missing packages/files referenced. The failure is due to Java/Gradle version compatibility rather than a missing file. - Version mismatch info - Base image: gradle:jdk11 (Java 11) - Gradle wrapper: gradle-4.1-all.zip (Gradle 4.1) - Issue: Could not determine java version from '11.0.30' indicates incompatibility between Gradle 4.1 and Java 11 (Gradle 4.1 does not support JDK 11). - Suggested fix: Use a Gradle version compatible with JDK 11 or downgrade to a JDK 8/9-8 environment.
FROM gradle:jdk8
# Install required packages for Android SDK
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates tzdata && \
rm -rf /var/lib/apt/lists/*
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
RUN mkdir -p ${ANDROID_HOME} && \
mkdir -p ${ANDROID_HOME}/cmdline-tools && \
curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools && \
rm /tmp/commandlinetools.zip && \
# Locate sdkmanager and run to install required components
SDKMANAGER=$(find ${ANDROID_HOME} -name sdkmanager | head -n1); \
if [ -n "$SDKMANAGER" ]; then echo "sdkmanager at $SDKMANAGER"; \
chmod +x "$SDKMANAGER"; \
yes | "$SDKMANAGER" --sdk_root="${ANDROID_HOME}" \
"platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; \
else echo "sdkmanager not found"; exit 1; fi
# Copy source and build
WORKDIR /workspace
COPY . /workspace
# Ensure gradlew is executable and build the project
RUN chmod +x gradlew && \
./gradlew :DanmakuFlameMaster:assembleRelease
# Default command: show build artifacts (no long-running process)
CMD ["bash","-lc","echo Build completed. Artifacts located at DanmakuFlameMaster/build/outputs/aar; ls -la DanmakuFlameMaster/build/outputs/aar || true"]
- VerifyBuild status: build_failed - Concerns - Hard-coded Android commandline-tools URL and specific component versions; brittle if Google changes assets or requires login. - Assumes repository contains DanmakuFlameMaster Gradle module and gradlew wrapper; if project layout differs, build may fail. - Failing step - Dockerfile step [3/6]: RUN mkdir -p /opt/android-sdk && mkdir -p /opt/android-sdk/cmdline-tools && curl -sSL https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /opt/android-sdk/cmdline-tools && rm /tmp/commandlinetools.zip && SDKMANAGER=$(find /opt/android-sdk -name sdkmanager | head -n1); if [ -n "$SDKMANAGER" ]; then echo "sdkmanager at $SDKMANAGER"; chmod +x "$SDKMANAGER"; yes | "$SDKMANAGER" --sdk_root="/opt/android-sdk" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"; else echo "sdkmanager not found"; exit 1; fi - Exact error message(s) and exit code - Error: A JNI error has occurred, please check your installation and try again - Exception: java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 - Build log ends with: ERROR: failed to build: failed to solve: process "/bin/sh -c ... " did not complete successfully: exit code: 1 - Missing packages or files mentioned - The step attempts to install: platforms;android-25, build-tools;26.0.2, ndk;21.0.6113669 - The command downloads and extracts Android command-line tools to /opt/android-sdk/cmdline-tools, then runs sdkmanager located at /opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager - No explicit “not found” in the error; the failure occurs during sdkmanager invocation due to Java version mismatch - Version mismatch / root cause - Base image uses Gradle with JDK 8 (gradle:jdk8) - Error indicates Java class file version mismatch: com/android/prefs/AndroidLocationsProvider compiled for Java 11 (55.0) but runtime supports up to Java 8 (52.0) - This causes sdkmanager to fail with JNI error and UnsupportedClassVersionError - Notes - Failure occurred during Android SDK CLI tools setup after sdkmanager located at /opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager - Tool cannot run under Java 8 runtime; fixes: use a newer base image with newer JDK (e.g., gradle:jdk11+) or use an Android CLI tools version compatible with Java 8
# Multi-stage Dockerfile to build DanmakuFlameMaster from source and collect artifacts
# Stage 1: builder with Android SDK and Gradle
FROM gradle:jdk8 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential system dependencies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK locations and PATH
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=$ANDROID_SDK_ROOT
ENV PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
# Install Android command-line tools and required platforms/build-tools/NDK
RUN mkdir -p $ANDROID_SDK_ROOT/cmdline-tools && \
curl -sS https://dl.google.com/android/repository/commandlinetools-linux-latest.zip -o /tmp/commandlinetools-linux-latest.zip && \
unzip -q /tmp/commandlinetools-linux-latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools && \
mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/latest && \
rm -f /tmp/commandlinetools-linux-latest.zip
# Accept licenses and install necessary SDK components
RUN yes | sdkmanager --licenses || true
RUN yes | sdkmanager "platform-tools" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
WORKDIR /workspace
# Copy source code into the image
COPY . /workspace
# Build the DanmakuFlameMaster module; skip unit tests for speed
RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease -x test -x androidTest
# Stage 2: Runtime image that holds build artifacts
FROM alpine:3.19 AS runtime
# Minimal runtime with certificates
RUN apk add --no-cache ca-certificates
# Copy built artifacts from builder stage
COPY --from=builder /workspace/DanmakuFlameMaster/build/outputs/aar /artifacts/aar
WORKDIR /artifacts
# Default command lists available artifacts
CMD ["sh", "-lc", "echo 'DanmakuFlameMaster release AARs available at /artifacts/aar'; ls -la /artifacts/aar; sleep 3600"]
# Docker ignore file to keep build context small .git .gitignore .gradle **/build/ **/out/ **/.gradle/ *.log .DS_Store Sample/
- Exact error message and exit code:
- Exit code: 9
- Error text from the failing step:
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /tmp/commandlinetools-linux-latest.zip or
/tmp/commandlinetools-linux-latest.zip.zip, and cannot find /tmp/commandlinetools-linux-latest.zip.ZIP, period.
- Failing command/step:
- Builder step: [builder 3/8] RUN mkdir -p /opt/android-sdk/cmdline-tools && curl -sS https://dl.google.com/android/repository/commandlinetools-linux-latest.zip -o /tmp/commandlinetools-linux-latest.zip && unzip -q /tmp/commandlinetools-linux-latest.zip -d /opt/android-sdk/cmdline-tools && mv /opt/android-sdk/cmdline-tools/cmdline-tools /opt/android-sdk/cmdline-tools/latest && rm -f /tmp/commandlinetools-linux-latest.zip
- Missing packages or files mentioned:
- The downloaded file /tmp/commandlinetools-linux-latest.zip is not a valid ZIP archive (contains End-of-central-directory signature errors). No specific missing package is cited; the issue is with the downloaded ZIP content being invalid.
- Version mismatch info:
- None observed in the log. The step uses commandlinetools-linux-latest.zip from Google's repository; no explicit version mismatch is reported.# Multi-stage Dockerfile to build DanmakuFlameMaster from source and collect artifacts
# Stage 1: builder with Android SDK and Gradle
FROM gradle:jdk8 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential system dependencies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK locations and PATH
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=$ANDROID_SDK_ROOT
ENV PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
# Install Android command-line tools and required platforms/build-tools/NDK
RUN mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
RUN curl -sS -L https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /tmp/commandlinetools && \
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools/latest && \
mv /tmp/commandlinetools/cmdline-tools/* $ANDROID_SDK_ROOT/cmdline-tools/latest/ && \
rm -f /tmp/commandlinetools.zip
# Accept licenses and install required SDK components
RUN yes | sdkmanager --licenses || true
RUN yes | sdkmanager "platform-tools" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
WORKDIR /workspace
# Copy source code into the image
COPY . /workspace
# Build the DanmakuFlameMaster module; skip unit tests for speed
RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease -x test -x androidTest
# Stage 2: Runtime image that holds build artifacts
FROM alpine:3.20 AS runtime
# Minimal runtime with certificates
RUN apk add --no-cache ca-certificates
# Copy built artifacts from builder stage
COPY --from=builder /workspace/DanmakuFlameMaster/build/outputs/aar /artifacts/aar
WORKDIR /artifacts
# Default command lists available artifacts
CMD ["sh", "-lc", "echo 'DanmakuFlameMaster release AARs available at /artifacts/aar'; ls -la /artifacts/aar"]
- Failing step (caused the failure):
- Dockerfile: RUN yes | sdkmanager "platform-tools" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669" (builder 6/9)
- Exit code: 1
- Exact error messages:
- Error: A JNI error has occurred, please check your installation and try again
- Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
- Earlier related failures (same root cause):
- builder 5/9 RUN yes | sdkmanager --licenses || true produced:
- Error: A JNI error has occurred, please check your installation and try again
- Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
- Missing packages or files mentioned:
- None stated as missing. The failure is due to a Java runtime class version mismatch rather than a missing file or package.
- Version mismatch info:
- The error indicates a Java class version mismatch: class file version 55.0 (compiled with a newer JDK, e.g., Java 11) is being run on a runtime that supports up to 52.0 (Java 8).
- Root cause: The build uses a Java 8-based environment (gradle:jdk8) while sdkmanager/Android command-line tools are being executed with a newer-compiled class, requiring Java 11+.
- Suggested fix (brief):
- Use a Java 11+ base image or install and configure Java 11 (JAVA_HOME) so the sdkmanager tools run with a compatible JRE/JDK.# Multi-stage Dockerfile to build DanmakuFlameMaster from source and collect artifacts
# Stage 1: builder with Android SDK and Gradle
FROM gradle:jdk11 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential system dependencies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK locations and PATH
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=$ANDROID_SDK_ROOT
ENV PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
# Install Android command-line tools and required platforms/build-tools/NDK
RUN mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
RUN curl -sS -L https://dl.google.com/android/repository/commandlinetools-linux-latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /tmp/commandline-tools && \
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools/latest && \
mv /tmp/commandline-tools/cmdline-tools/* $ANDROID_SDK_ROOT/cmdline-tools/latest/ && \
rm -f /tmp/commandlinetools.zip
# Accept licenses and install required SDK components
RUN yes | sdkmanager --licenses || true
RUN yes | sdkmanager "platform-tools" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
WORKDIR /workspace
# Copy source code into the image
COPY . /workspace
# Build the DanmakuFlameMaster module; skip unit tests for speed
RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease -x test -x androidTest
# Stage 2: Runtime image that holds build artifacts
FROM alpine:3.20 AS runtime
# Minimal runtime with certificates
RUN apk add --no-cache ca-certificates
# Copy built artifacts from builder stage
COPY --from=builder /workspace/DanmakuFlameMaster/build/outputs/aar /artifacts/aar
WORKDIR /artifacts
# Default command lists available artifacts
CMD ["sh", "-lc", "echo 'DanmakuFlameMaster release AARs available at /artifacts/aar'; ls -la /artifacts/aar"]
- Build status: VerifyBuild status: build_failed - Key concerns (concise): - Android SDK components pulled during build; network-dependent and slow in restricted environments. - Copy step assumes artifacts land in /workspace/DanmakuFlameMaster/build/outputs/aar; Gradle/AGP version changes could alter output paths/file naming. - Builder runs as root; consider using a non-root user and tighter permissions. - Primary build error: - End-of-central-directory signature not found. Either this file is not a zipfile, or it is a multi-part archive. - unzip: cannot find zipfile directory in one of /tmp/commandlinetools.zip or /tmp/commandlinetools.zip.zip, and cannot find /tmp/commandlinetools.zip.ZIP. - Failing command/step: - [builder 4/9] RUN curl -sS -L https://dl.google.com/android/repository/commandlinetools-linux-latest.zip -o /tmp/commandlinetools.zip && unzip -q /tmp/commandlinetools.zip -d /tmp/commandline-tools && mkdir -p $ANDROID_SDK_ROOT/cmdline-tools/latest && mv /tmp/commandline-tools/cmdline-tools/* $ANDROID_SDK_ROOT/cmdline-tools/latest/ && rm -f /tmp/commandlinetools.zip - Exit code: - did not complete successfully: exit code: 9 - Missing files or packages: - The downloaded file /tmp/commandlinetools.zip is not a valid zip; unzip cannot locate a zipfile directory in /tmp/commandlinetools.zip. - Issue is with the downloaded artifact from the URL; no specific missing system package reported. - Version mismatch info: - No explicit version mismatch reported. The failure is due to corrupted/downloaded artifact (commandlinetools-linux-latest.zip); the problem lies with the downloaded file, not with listed package versions. - Relevant paths/URLs to note: - /workspace/DanmakuFlameMaster/build/outputs/aar (artifact copy location) - /tmp/commandlinetools.zip - /tmp/commandline-tools - /tmp/commandlinetools.zip (repeated) - $ANDROID_SDK_ROOT/cmdline-tools/latest - URL: https://dl.google.com/android/repository/commandlinetools-linux-latest.zip
circleci/android (85 stars): CircleCI images for Android cimg/android (43 stars): jetbrains/qodana-jvm-android (2 stars): Qodana for Android projects lacework/test-latest-dockerhub-tag (0 stars): test-latest-dockerhub-tag journeyapps/android-node-test-base (0 stars): jetbrains/qodana-android (0 stars): Qodana for Android projects rancher/vm-android (1 stars): keyfactor/command-cert-manager-issuer (0 stars): Command external issuer for cert-manager eclipse/ubuntu_android (4 stars): Ubuntu 14, Java 1.8, Maven 3.2.3, Android (21 api level) eclipse/android (5 stars): Centos based images with Android SDK and vnc
# Multi-stage Dockerfile to build DanmakuFlameMaster from source and collect artifacts
# Stage 1: builder with Android SDK and Gradle
FROM gradle:jdk11 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install essential system dependencies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends curl unzip zip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Android SDK locations and PATH
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=$ANDROID_SDK_ROOT
ENV PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
# Install Android command-line tools and required platforms/build-tools/NDK
RUN mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
RUN curl -sS -L https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o /tmp/commandlinetools.zip && \
unzip -q /tmp/commandlinetools.zip -d /tmp/commandline-tools && \
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools/latest && \
mv /tmp/commandline-tools/cmdline-tools/* $ANDROID_SDK_ROOT/cmdline-tools/latest/ && \
rm -f /tmp/commandlinetools.zip
# Accept licenses and install required SDK components
RUN yes | sdkmanager --licenses || true
RUN yes | sdkmanager "platform-tools" "platforms;android-25" "build-tools;26.0.2" "ndk;21.0.6113669"
WORKDIR /workspace
# Copy source code into the image
COPY . /workspace
# Build the DanmakuFlameMaster module; skip unit tests for speed
RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease -x test -x androidTest
# Stage 2: Runtime image that holds build artifacts
FROM alpine:3.20 AS runtime
# Minimal runtime with certificates
RUN apk add --no-cache ca-certificates
# Copy built artifacts from builder stage
COPY --from=builder /workspace/DanmakuFlameMaster/build/outputs/aar /artifacts/aar
WORKDIR /artifacts
# Default command lists available artifacts
CMD ["sh", "-lc", "echo 'DanmakuFlameMaster release AARs available at /artifacts/aar'; ls -la /artifacts/aar"]
- Exact error message and exit code: - Could not determine java version from '11.0.30'. - Exit code: 1 - Failing command/step: - [builder 9/9] RUN chmod +x gradlew && ./gradlew :DanmakuFlameMaster:assembleRelease -x test -x androidTest - Missing packages or files mentioned: - None explicitly reported as missing. The failure is due to Java/Gradle compatibility, not a missing file. The log does show license prompts during sdk setup, but licenses were accepted; no missing package/file error is shown in the failing step. - Version mismatch / compatibility info: - The build uses Gradle 4.1 (gradle-4.1-all.zip) via the wrapper, while running with JDK 11 (11.0.30). The error arises because Gradle 4.1 cannot determine the Java version from Java 11, indicating an incompatibility between Gradle 4.1 and Java 11. - Implication: need Java 8 (or a Gradle version that supports Java 11, e.g., Gradle 5.x/6.x) or adjust the Docker image to use a compatible JDK/Gradle combination.