FROM gradle:jdk8
LABEL maintainer="BuildAgent"
# Install required system packages (including Android build dependencies)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip git build-essential cmake && \
rm -rf /var/lib/apt/lists/*
# Android SDK/NDK setup
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools"
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o /tmp/commandlinetools-linux.zip -L https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip && \
unzip /tmp/commandlinetools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
# Move to a stable path that sdkmanager expects
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
rm /tmp/commandlinetools-linux.zip
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
RUN mkdir -p ${ANDROID_SDK_ROOT}/platforms ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/ndk
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Install required Android components
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"platforms;android-28" "build-tools;28.0.3" "ndk;21.4.7075529"
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529
ENV PATH="$PATH:${ANDROID_NDK_HOME}"
WORKDIR /workspace
# Copy source
COPY . /workspace
# Build the project (prefer wrapper if present, else system Gradle)
RUN chmod +x ./gradlew || true
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
# Default command
CMD ["/bin/bash"]
# Ignore VCS and build artifacts .git .gradle build out android/.gradle android/build Specs/**/build Specs/**/out *.log *.class *.o *.so *.dll *.pyc *.pyo *.tmp .idea *.iml .gradlew.cache .gradlew .DS_Store
Here is the key failure condensed. - Exact error message and exit code - Exit code: 1 - BUILD FAILED in 51s - Build file '/workspace/android/build.gradle' line: 6 - A problem occurred evaluating project ':android'. - > Failed to apply plugin 'com.android.internal.library'. - > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. - Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory) - Failing command/step - RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi - This is the step that failed (the Gradle build execution). - Missing packages or files mentioned - None explicitly missing; the error is due to a Java version mismatch. - Version mismatch context: Android Gradle plugin requires Java 11, but the image uses Java 8 (gradle:jdk8). - Version mismatch info - Base image uses Gradle/JDK 8 (gradle:jdk8) - Android Gradle plugin requires Java 11 to run (error message observed) - Gradle version in use (from log): Gradle 7.3.3 (seen during the run) - Quick takeaway - The build fails due to Java version incompatibility: upgrade the Docker base image to include Java 11 (or higher) or align Gradle/Android Gradle Plugin versions with Java 8 compatibility.
FROM gradle:jdk11
LABEL maintainer="BuildAgent"
# Install required system packages (including Android build dependencies)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip git build-essential cmake && \
rm -rf /var/lib/apt/lists/*
# Android SDK/NDK setup
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools"
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o /tmp/commandlinetools-linux.zip -L https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip && \
unzip /tmp/commandlinetools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
# Move to a stable path that sdkmanager expects
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
rm /tmp/commandlinetools-linux.zip
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
RUN mkdir -p ${ANDROID_SDK_ROOT}/platforms ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/ndk
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Install required Android components
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"platforms;android-28" "build-tools;28.0.3" "ndk;21.4.7075529"
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529
ENV PATH="$PATH:${ANDROID_NDK_HOME}"
WORKDIR /workspace
# Copy source
COPY . /workspace
# Build the project (prefer wrapper if present, else system Gradle)
RUN chmod +x ./gradlew || true
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
# Default command
CMD ["/bin/bash"]
Exact error, exit code, and failing step:
- Exit code: 1
- Failing command/step:
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
- Exact error message:
Execution failed for task ':android:configureCMakeDebug'.
C/C++: /workspace/android/CMakeLists.txt debug|armeabi-v7a : CMake Error at /workspace/android/CMakeLists.txt:43 (add_subdirectory):
The source directory
/workspace/androidLibs/third-party/glog/merge/glog
does not contain a CMakeLists.txt file.
Missing packages or files mentioned:
- Missing file/directory: /workspace/androidLibs/third-party/glog/merge/glog/CMakeLists.txt (the path exists but lacks a CMakeLists.txt).
Version mismatch / warnings observed:
- CXX5304 warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered (likely due to mismatched Android SDK/IDE tool versions).
- Repeated warnings: “unexpected element (uri:"", local:"base-extension"). Expected elements are <codename>,<layoutlib>,<api-level>” during SDK/Qt/CMake configuration.
Summary:
The build fails during the Gradle run at Android CMake configuration due to a missing CMakeLists.txt in /workspace/androidLibs/third-party/glog/merge/glog. There are also version-mismatch warnings (SDK XML version 3) and related base-extension warnings that may affect tool compatibility.cmake_minimum_required(VERSION 3.6.0) project(glog CXX) add_library(glog INTERFACE) target_include_directories(glog INTERFACE .. glog-0.4.0/src )
Error: file not found: androidLibs/third-party/glog/merge/glog/CMakeLists.txt
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
buildConfigField "boolean", "IS_INTERNAL_BUILD", 'true'
ndk {
abiFilters 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
}
externalNativeBuild {
cmake {
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared'
targets 'spectrum'
}
}
consumerProguardFiles 'proguard-spectrum.pro'
}
externalNativeBuild {
cmake {
path './CMakeLists.txt'
}
}
dependencies {
implementation project(':fbjni')
compileOnly deps.jsr305
implementation deps.soloader
testImplementation deps.festAssert
testImplementation deps.junit
testImplementation deps.mockitoCore
testImplementation deps.robolectric
}
}
apply plugin: 'com.vanniktech.maven.publish'
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts.add('archives', sourcesJar)
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required (VERSION 3.6.0)
project(spectrum CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
set(spectrum_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp)
file(GLOB spectrum_SOURCES
${spectrum_DIR}/spectrumjni/*.cpp
${spectrum_DIR}/spectrumjni/image/*.cpp
${spectrum_DIR}/spectrumjni/io/*.cpp
${spectrum_DIR}/spectrumjni/plugins/*.cpp
${spectrum_DIR}/spectrumjni/requirements/*.cpp
)
add_library(spectrum SHARED
${spectrum_SOURCES}
)
target_compile_options(spectrum PRIVATE
-DSPECTRUM_OSS
-fexceptions
-DNDEBUG
)
target_include_directories(spectrum PUBLIC
${spectrum_DIR}
)
set(EXTERNAL_DIR ${CMAKE_CURRENT_LIST_DIR}/../androidLibs/third-party/)
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
file(MAKE_DIRECTORY ${BUILD_DIR})
set(glog_DIR ${EXTERNAL_DIR}/glog/merge/glog)
set(glog_BUILD_DIR ${BUILD_DIR}/glog/${ANDROID_ABI})
add_subdirectory(${glog_DIR} ${glog_BUILD_DIR})
set(folly_DIR ${EXTERNAL_DIR}/folly/merge/folly)
set(folly_BUILD_DIR ${BUILD_DIR}/folly/${ANDROID_ABI})
add_subdirectory(${folly_DIR} ${folly_BUILD_DIR})
set(spectrumcpp_DIR ${CMAKE_CURRENT_LIST_DIR}/../cpp/)
set(spectrumcpp_BUILD_DIR ${BUILD_DIR}/spectrumcpp/${ANDROID_ABI})
add_subdirectory(${spectrumcpp_DIR} ${spectrumcpp_BUILD_DIR})
set(fbjni_DIR ${CMAKE_CURRENT_LIST_DIR}/../androidLibs/fbjni/)
set(fbjni_BUILD_DIR ${BUILD_DIR}/fbjni/${ANDROID_ABI})
add_subdirectory(${fbjni_DIR} ${fbjni_BUILD_DIR})
target_link_libraries(spectrum
folly
glog
jnigraphics
spectrumfbjni
spectrumcpp
)
FROM gradle:jdk11
LABEL maintainer="BuildAgent"
# Install required system packages (including Android build dependencies)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip git build-essential cmake && \
rm -rf /var/lib/apt/lists/*
# Android SDK/NDK setup
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools"
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o /tmp/commandlinetools-linux.zip -L https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip && \
unzip /tmp/commandlinetools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
# Move to a stable path that sdkmanager expects
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
rm /tmp/commandlinetools-linux.zip
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
RUN mkdir -p ${ANDROID_SDK_ROOT}/platforms ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/ndk
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Install required Android components
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"platforms;android-28" "build-tools;28.0.3" "ndk;21.4.7075529"
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529
ENV PATH="$PATH:${ANDROID_NDK_HOME}"
WORKDIR /workspace
# Create a minimal, compatible CMake setup for missing third-party glog
RUN mkdir -p androidLibs/third-party/glog/merge/glog/../../override
RUN mkdir -p androidLibs/third-party/glog/merge/glog
RUN bash -lc 'cat > androidLibs/third-party/glog/merge/glog/CMakeLists.txt <<"CMAKE"\ncmake_minimum_required(VERSION 3.6.0)\nproject(glog CXX)\n\nadd_subdirectory(../../override ${CMAKE_BINARY_DIR}/glog_override_build)\nCMAKE' \
# Copy source
COPY . /workspace
# Build the project (prefer wrapper if present, else system Gradle)
RUN chmod +x ./gradlew || true
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
# Default command
CMD ["/bin/bash"]
- Build status: VerifyBuild status: build_failed
- Summary of actionable issues
- Potential Dockerfile syntax risk: The RUN instruction that creates the CMakeLists.txt ends with a trailing backslash and is followed by a COPY instruction. Depending on Docker version, this could be misparsed. Consider splitting into separate RUN and COPY steps.
- Android SDK/NDK installation steps rely on external URLs which may change or become unavailable. Consider pinning versions and/or adding checks to verify successful installation.
- The image installs a large Android toolchain which can bloat the image. If the native library build is optional for CI, consider a lighter multi-stage approach or optional build flags.
- Failing step and command
- [10/12] RUN bash -lc 'cat > androidLibs/third-party/glog/merge/glog/CMakeLists.txt <<"CMAKE"\ncmake_minimum_required(VERSION 3.6.0)\nproject(glog CXX)\n\nadd_subdirectory(../../override ${CMAKE_BINARY_DIR}/glog_override_build)\nCMAKE' COPY . /workspace
- Exact error messages and exit code
- Exit code: 2
- process "/bin/sh -c bash -lc 'cat > androidLibs/third-party/glog/merge/glog/CMakeLists.txt <<\"CMAKE\"\\ncmake_minimum_required(VERSION 3.6.0)\\nproject(glog CXX)\\n\\nadd_subdirectory(../../override ${CMAKE_BINARY_DIR}/glog_override_build)\\nCMAKE' did not complete successfully: exit code: 2
- 0.150 COPY: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `CMAKEncmake_minimum_required')
- 0.150 COPY: -c: line 1: syntax error near unexpected token `('
- 0.150 COPY: -c: line 1: `cat > androidLibs/third-party/glog/merge/glog/CMakeLists.txt <<"CMAKE"\ncmake_minimum_required(VERSION 3.6.0)\nproject(glog CXX)\n\nadd_subdirectory(../../override ${CMAKE_BINARY_DIR}/glog_override_build)\nCMAKE'
- Missing packages or files mentioned
- None reported. The failure is due to a shell here-document syntax issue, not a missing package/file.
- Version mismatch info
- None explicitly reported. The CMake snippet shows cmake_minimum_required(VERSION 3.6.0), but no mismatch/error indicating a version problem.
- Additional warning context
- 1 warning found (use docker --debug to expand): NoEmptyContinuation: Empty continuation line (line 44)FROM gradle:jdk11
LABEL maintainer="BuildAgent"
# Install required system packages (including Android build dependencies)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip git build-essential cmake && \
rm -rf /var/lib/apt/lists/*
# Android SDK/NDK setup
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools"
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o /tmp/commandlinetools-linux.zip -L https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip && \
unzip /tmp/commandlinetools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
# Move to a stable path that sdkmanager expects
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
rm /tmp/commandlinetools-linux.zip
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
RUN mkdir -p ${ANDROID_SDK_ROOT}/platforms ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/ndk
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Install required Android components
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"platforms;android-28" "build-tools;28.0.3" "ndk;21.4.7075529"
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529
ENV PATH="$PATH:${ANDROID_NDK_HOME}"
WORKDIR /workspace
# Create a minimal, compatible CMake setup for missing third-party glog
RUN mkdir -p androidLibs/third-party/glog/merge/glog
RUN bash -lc 'printf "cmake_minimum_required(VERSION 3.6.0)\nproject(glog CXX)\nadd_subdirectory(../../override ${CMAKE_BINARY_DIR}/glog_override_build)\n" > androidLibs/third-party/glog/merge/glog/CMakeLists.txt'
# Copy source
COPY . /workspace
# Build the project (prefer wrapper if present, else system Gradle)
RUN chmod +x ./gradlew || true
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
# Default command
CMD ["/bin/bash"]
- Exact error message and exit code
- Execution failed for task ':android:configureCMakeDebug'.
> C/C++: /workspace/android/CMakeLists.txt debug|armeabi-v7a : CMake Error at /workspace/android/CMakeLists.txt:47 (add_subdirectory):
The source directory
/workspace/androidLibs/third-party/folly/merge/folly
does not contain a CMakeLists.txt file.
- BUILD FAILED in 1m 5s
- The final process exit line:
"ERROR: failed to build: failed to solve: process "/bin/sh -c if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi" did not complete successfully: exit code: 1"
- Failing command/step
- RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi (Dockerfile: 47)
- Missing packages or files mentioned
- Missing CMakeLists.txt in the directory:
/workspace/androidLibs/third-party/folly/merge/folly
- This path is referenced by /workspace/android/CMakeLists.txt:47 (add_subdirectory)
- Version mismatch / warnings observed
- [CXX5304] This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered.
- Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> (repeated)
- The log also shows Kotlin Android Extensions deprecation notice and other Android SDK tool/version chatter, but the key mismatches are the CXX5304 warning and the base-extension warnings.cmake_minimum_required(VERSION 3.6.0) project(folly CXX) add_library(folly INTERFACE) target_compile_definitions(folly INTERFACE -DFOLLY_NO_CONFIG -DFOLLY_HAVE_MEMRCHR -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 ) target_include_directories(folly INTERFACE . )
FROM gradle:jdk11
LABEL maintainer="BuildAgent"
WORKDIR /workspace
# Install required system packages (including Android build dependencies)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl unzip git build-essential cmake openjdk-11-jdk-headless && \
rm -rf /var/lib/apt/lists/*
# Android SDK/NDK setup
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_HOME}/emulator"
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
curl -o /tmp/commandlinetools-linux.zip -L https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip && \
unzip -o /tmp/commandlinetools-linux.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \
mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/tools && \
rm /tmp/commandlinetools-linux.zip
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
RUN mkdir -p ${ANDROID_SDK_ROOT}/platforms ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/ndk
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Install required Android components
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"platforms;android-28" "build-tools;28.0.3" "ndk;21.4.7075529"
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529
ENV PATH="$PATH:${ANDROID_NDK_HOME}"
# Copy source
COPY . /workspace
RUN chmod +x ./gradlew || true
RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi
CMD ["/bin/bash"]
- Exact error message and exit code: - Exit code: 1 - Failing message: Execution failed for task ':android:configureCMakeDebug'. - Additional detail: The source directory /workspace/androidLibs/third-party/glog/merge/glog does not contain a CMakeLists.txt file. - Failing command/step: - Step: [10/10] RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi - Command line involved: ./gradlew build -x test (or gradle build if no gradlew) - Missing packages/files mentioned: - Missing file: /workspace/androidLibs/third-party/glog/merge/glog/CMakeLists.txt (the source directory referenced does not contain a CMakeLists.txt). - Version mismatch / notable warnings: - CXX5304 warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. - Warnings about unexpected XML elements: base-extension (repeated). - Additional watch-related warning: Unable to list file systems to check whether they can be watched.
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required (VERSION 3.6.0)
project(spectrum CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
set(spectrum_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp)
file(GLOB spectrum_SOURCES
${spectrum_DIR}/spectrumjni/*.cpp
${spectrum_DIR}/spectrumjni/image/*.cpp
${spectrum_DIR}/spectrumjni/io/*.cpp
${spectrum_DIR}/spectrumjni/plugins/*.cpp
${spectrum_DIR}/spectrumjni/requirements/*.cpp
)
add_library(spectrum SHARED
${spectrum_SOURCES}
)
target_compile_options(spectrum PRIVATE
-DSPECTRUM_OSS
-fexceptions
-DNDEBUG
)
target_include_directories(spectrum PUBLIC
${spectrum_DIR}
)
set(EXTERNAL_DIR ${CMAKE_CURRENT_LIST_DIR}/../androidLibs/third-party/)
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
file(MAKE_DIRECTORY ${BUILD_DIR})
set(glog_DIR ${EXTERNAL_DIR}/glog/override)
set(glog_BUILD_DIR ${BUILD_DIR}/glog/${ANDROID_ABI})
add_subdirectory(${glog_DIR} ${glog_BUILD_DIR})
set(folly_DIR ${EXTERNAL_DIR}/folly/override)
set(folly_BUILD_DIR ${BUILD_DIR}/folly/${ANDROID_ABI})
add_subdirectory(${folly_DIR} ${folly_BUILD_DIR})
set(spectrumcpp_DIR ${CMAKE_CURRENT_LIST_DIR}/../cpp/)
set(spectrumcpp_BUILD_DIR ${BUILD_DIR}/spectrumcpp/${ANDROID_ABI})
add_subdirectory(${spectrumcpp_DIR} ${spectrumcpp_BUILD_DIR})
set(fbjni_DIR ${CMAKE_CURRENT_LIST_DIR}/../androidLibs/fbjni/)
set(fbjni_BUILD_DIR ${BUILD_DIR}/fbjni/${ANDROID_ABI})
add_subdirectory(${fbjni_DIR} ${fbjni_BUILD_DIR})
set(spectrumfbjni_LIB_DIR /workspace/androidLibs/fbjni/build/${ANDROID_ABI})
# Note: link libraries in the correct order
target_link_libraries(spectrum
folly
glog
jnigraphics
spectrumfbjni
spectrumcpp
)
Pod::Spec.new do |spec|
spec.name = "spectrum-folly"
spec.version = "2019.01.21.00"
spec.license = { :type => "Apache License, Version 2.0" }
spec.homepage = "https://github.com/facebook/folly"
endDocker build failed (Exit code 1) - Failing step: [10/10] RUN if [ -f ./gradlew ]; then ./gradlew build -x test; else gradle build; fi - Exact command: the Gradle/Gradle wrapper build invoked by the Dockerfile at line 41 - Primary error: fatal error: 'folly/Optional.h' file not found - In file included from ../../../../src/main/cpp/spectrumjni/JniSpectrumException.cpp:6 - In file included from ../../../../src/main/cpp/spectrumjni/JniSpectrumException.h:8 - /workspace/cpp/./spectrum/SpectrumException.h:8:10: fatal error: 'folly/Optional.h' file not found - Additional missing Folly headers reported: - folly/FixedString.h not found (Format.h:8; Orientation.h -> Format.h) - folly/Range.h not found (IImageSource.h) - Summary of missing packages/files: - Folly headers not found: folly/Optional.h, folly/FixedString.h, folly/Range.h - Version mismatch / warnings: - [CXX5304] SDK XML versions up to 2; encountered SDK XML version 3 (Android Studio/tools version mismatch) - Environment notes: - Gradle 7.3.3 being downloaded/used; “Starting a Gradle Daemon” messages - Root failure attributed to missing Folly headers during Android native build (CMake/Ninja) for the spectrum target
FROM gradle:jdk8
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Android SDK/NDK installation
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/emulator
# Install command-line tools for Android SDK
RUN mkdir -p ${ANDROID_SDK_ROOT} \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fo commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip \
&& unzip commandlinetools-linux.zip -d cmdline-tools \
&& rm commandlinetools-linux.zip \
&& mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && mv cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools \
&& yes | sdkmanager --licenses
# Accept licenses and install platform tools and required platforms/ndk
RUN yes | sdkmanager "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Ensure Gradle wrapper is executable and build the Android project
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
# Ignore VCS metadata .git # Gradle and Android build caches .gradle android/.gradle android/build android/**/build android/**/cmake-build-* android/**/CMakeFiles android/**/build-tools android/**/ndk android/.gradle android/gradle # Common build outputs build **/build **/out **/*.log # Node projects (if any) node_modules # IDE files *.iml *.ipr *.iws .DS_Store .idea # Misc *.tmp *.tmp~
- Exact error message and exit code
- mv: cannot move 'cmdline-tools' to a subdirectory of itself, '/opt/android-sdk/cmdline-tools/cmdline-tools'
- Exit code: 1
- Failing command/step
- Dockerfile step [3/7]: RUN mkdir -p ${ANDROID_SDK_ROOT} && cd ${ANDROID_SDK_ROOT} && curl -fo commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && unzip commandlinetools-linux.zip -d cmdline-tools && rm commandlinetools-linux.zip && mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && mv cmdline-tools /opt/android-sdk/cmdline-tools && yes | sdkmanager --licenses
- Missing packages or files mentioned
- None reported as missing; apt-get/install steps completed. The failure is due to an incorrect mv operation creating a nested directory (/opt/android-sdk/cmdline-tools/cmdline-tools) rather than a simple relocation.
- Version mismatch info
- Downloads the Android command-line tools via commandlinetools-linux-7583922_latest.zip (version indicated in the URL). No other version mismatch is mentioned; the issue stems from path handling after extraction.FROM gradle:jdk8
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Android SDK/NDK installation
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/emulator
# Install command-line tools for Android SDK
RUN mkdir -p ${ANDROID_SDK_ROOT} \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fo commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip \
&& unzip commandlinetools-linux.zip -d cmdline-tools \
&& rm commandlinetools-linux.zip \
# Note: do not move cmdline-tools directory to avoid nested paths
# Accept licenses and install platform tools and required platforms/ndk
&& yes | sdkmanager --licenses
RUN yes | sdkmanager "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Ensure Gradle wrapper is executable and build the Android project
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
- Exact error message and exit code - /bin/sh: 1: sdkmanager: not found - Exit code: 127 - Failing command/step - Dockerfile step [3/7]: RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && curl -fo commandlinetools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && unzip commandlinetools-linux.zip -d cmdline-tools && rm commandlinetools-linux.zip && yes | sdkmanager --licenses - Missing packages or files mentioned - The sdkmanager binary is not found in PATH after extraction. The log shows sdkmanager existed at cmdline-tools/cmdline-tools/bin/sdkmanager, but the shell cannot locate sdkmanager as a runnable command. - This suggests PATH is not set to include the extracted tools directory, or the expected path differs due to version layout. - Version mismatch / path remediation info - Downloaded tool version: commandlinetools-linux-7583922_latest.zip - Extraction layout places sdkmanager under cmdline-tools/cmdline-tools/bin/sdkmanager (nested), not at a top-level bin/sdkmanager. This version structure requires adjusting PATH or calling the full path to the binary (e.g., /opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager) for license acceptance.
FROM gradle:jdk8
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
# Include various possible locations for sdkmanager in PATH for robustness
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/bin:${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools"
# Install Android command-line tools (sdkmanager) robustly
RUN mkdir -p ${ANDROID_SDK_ROOT} \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fo /tmp/commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip \
&& unzip /tmp/commandlinetools.zip -d /tmp/commandline-tools-extract \
&& rm /tmp/commandlinetools.zip \
&& mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& mv /tmp/commandline-tools-extract/cmdline-tools/* ${ANDROID_SDK_ROOT}/cmdline-tools/ \
&& rm -rf /tmp/commandline-tools-extract
# Accept licenses and install platform tools, platforms, ndk (font end for CMake builds)
RUN set -e; \
if [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager"; \
elif [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager"; \
else echo 'sdkmanager not found'; exit 1; fi; \
yes | "$SDK_MANAGER" --licenses; \
if [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager"; \
elif [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager"; \
else echo 'sdkmanager not found 2'; exit 1; fi; \
"$SDK_MANAGER" "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Ensure Gradle wrapper is executable and build the Android project
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
Summary of Docker build error
- Exact error message and exit code
- Error: Could not determine SDK root.
- Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/
- Exit code: 1
- Failing command/step
- Dockerfile step [4/7]:
RUN set -e; \
if [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager"; \
elif [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager"; \
else echo 'sdkmanager not found'; exit 1; fi; \
yes | "$SDK_MANAGER" --licenses; \
if [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/bin/sdkmanager"; \
elif [ -x "${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager" ]; then SDK_MANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager"; \
else echo 'sdkmanager not found 2'; exit 1; fi; \
"$SDK_MANAGER" "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
- Missing packages or files mentioned
- The error indicates the Android SDK root cannot be determined, suggesting:
- ANDROID_SDK_ROOT is not set or paths are not in the expected location.
- Expected path reference: <sdk>/cmdline-tools/latest/
- No specific network/file download failure is reported; the failure is due to missing/unknown SDK root.
- Version mismatch info
- No explicit version mismatch is stated.
- The step attempts to install: platform-tools, platforms;android-33, build-tools;33.0.2, ndk;23.1.7779620.
- The failure occurs before these components are installed due to SDK root resolution issue.gradle (624 stars): Gradle is a fast, reliable, and flexible open-source build tool with an elegant, circleci/android (85 stars): CircleCI images for Android cimg/android (43 stars): bitnami/gradle (14 stars): Bitnami Secure Image for gradle jetbrains/qodana-jvm-android (2 stars): Qodana for Android projects chainguard/gradle (0 stars): Build, ship and run secure software with Chainguard's low-to-zero CVE container journeyapps/android-node-test-base (0 stars): jetbrains/qodana-android (0 stars): Qodana for Android projects okteto/gradle (1 stars): rancher/vm-android (1 stars):
circleci/android (85 stars): CircleCI images for Android circleci/circleci-cli (9 stars): CircleCI CLI circleci/node (135 stars): Node.js is a JavaScript-based platform for server-side and networking applicatio circleci/postgres (35 stars): The PostgreSQL object-relational database system provides reliability and data i circleci/ruby (80 stars): Ruby is a dynamic, reflective, object-oriented, general-purpose, open-source pro circleci/mysql (32 stars): MySQL is a widely used, open-source relational database management system (RDBMS circleci/python (116 stars): Python is an interpreted, interactive, object-oriented, open-source programming circleci/redis (18 stars): CircleCI images for Redis circleci/circleci-inferconfig (0 stars): circleci/docker-gc (6 stars): Agent to perform Docker image cache LRU garbage collection
FROM circleci/android:api-33
# Build Spectrum Android native library from source using Gradle and CMake
# This container uses CircleCI's Android image which includes the Android SDK/NDK and required tooling.
ENV DEBIAN_FRONTEND=noninteractive
# Set work directory
WORKDIR /workspace
# Copy source code
COPY . /workspace
# Ensure Gradle wrapper is executable and build the Android project
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
FROM gradle:jdk8
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
# Ensure correct PATH for sdkmanager binaries
ENV PATH="$PATH:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin"
# Install Android command-line tools (sdkmanager) robustly
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fsSL -o /tmp/commandlinetools_linux.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
&& unzip -q /tmp/commandlinetools_linux.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 -rf /tmp/commandlinetools* \
# Accept licenses and install platform tools, platforms, ndk (for CMake builds)
&& /bin/bash -lc 'yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses' \
&& /bin/bash -lc 'yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager \"platform-tools\" \"platforms;android-33\" \"build-tools;33.0.2\" \"ndk;23.1.7779620\"'
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Build the Android project with Gradle wrapper
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
- Build status: build_failed
- Concerns
- ENV PATH uses quotes which may prevent PATH expansion in some build environments; consider using PATH without quotes or explicit expansion.
- The Dockerfile hard-codes specific Android command-line tool versions and ZIP URLs which may break if the URL or version changes; consider pinning to a version and validating availability.
- The image is labeled for building only; if artifacts are needed at runtime, consider adding a separate runtime image or copying artifacts to a dedicated build output directory.
- Build error
- 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
- Failing command/step
- [3/6] RUN mkdir -p /opt/android-sdk/cmdline-tools && cd /opt/android-sdk && curl -fsSL -o /tmp/commandlinetools_linux.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip && unzip -q /tmp/commandlinetools_linux.zip -d /tmp/commandline-tools && mkdir -p /opt/android-sdk/cmdline-tools/latest && mv /tmp/commandline-tools/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest/ && rm -rf /tmp/commandlinetools* && /bin/bash -lc 'yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses' && /bin/bash -lc 'yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager \"platform-tools\" \"platforms;android-33\" \"build-tools;33.0.2\" \"ndk;23.1.7779620\"'
- The run attempts to install: platform-tools, platforms;android-33, build-tools;33.0.2, ndk;23.1.7779620
- Missing packages or files mentioned
- No explicit missing package/file error reported; failure is due to a Java class version mismatch when running sdkmanager (Java 11+ compiled code on a Java 8 runtime)
- Version mismatch info
- Class file version 55.0 (compiled with newer Java) is not supported by the runtime (supports up to 52.0)
- Base image uses gradle:jdk8 (Java 8), which is inconsistent with the Android tool class compiled for Java 11+FROM gradle:jdk11
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/emulator:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin
# Install Android command-line tools (sdkmanager) robustly
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fsSL -o /tmp/commandlinetools-linux_latest.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
&& unzip -qq /tmp/commandlinetools-linux_latest.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 -rf /tmp/commandlinetools-* \
&& yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
RUN ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Build the Android project with Gradle wrapper
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
Concerns: There are typos/inconsistencies in the Android command-line tools setup block: the curl output file name (/tmp/commandlinetools-linux_latest.zip) does not match the downloaded URL, and later unzip references /tmp/commandline-tools-linux_latest.zip; also paths vary between commandline-tools and commandlinetools, which will cause the sdkmanager step to fail., Residual inconsistent rm -rf paths and inconsistent naming (commandline-tools vs commandlinetools) that break file cleanup., Assumes an android/gradlew wrapper exists at that path; if the repo layout differs, the build step may fail.
FROM gradle:jdk11
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK, necessary build tools, and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies (Java base image provides JDK)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/emulator:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin
# Install Android command-line tools (sdkmanager) robustly
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fsSL -o /tmp/commandlinetools-linux_latest.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
&& unzip -qq /tmp/commandlinetools-linux_latest.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 -rf /tmp/commandlinetools-* \
&& yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
RUN ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Build the Android project with Gradle wrapper
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# The Android build produces artifacts in android/ (e.g., .aar). This image is intended for building only.
# Provide a shell to inspect artifacts when running the container.
CMD ["bash"]
Concerns: Android command-line tools download URL/filename mismatch: the curl downloads commandlinetools-linux_latest.zip while the URL references commandlinetools-linux_9477386_latest.zip, which will likely fail to download/unzip correctly., Build assumes android/gradlew exists and is executable; if the repository layout differs (e.g., a top-level gradlew or different path), the build step may fail., Artifacts produced by the build are not guaranteed to exist in a stable location; smoke tests rely on artifacts (aar/so/jar) that may not be present depending on the project configuration.
FROM gradle:jdk11
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin
# Install Android command-line tools (sdkmanager) robustly
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fsSL -o /tmp/commandlinetools-linux_latest.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
&& unzip -qq /tmp/commandlinetools-linux_latest.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 -rf /tmp/commandlinetools* \
&& yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
RUN ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager \
"platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Build the Android project with Gradle wrapper
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test
# Final runtime container setup
# This image is intended for building; artifacts are in android/
CMD ["bash"]
Summary (under 1500 chars): - Exact error message and exit code - chmod: cannot access 'android/gradlew': No such file or directory (exit code: 1) - Failing command/step - [7/7] RUN chmod +x android/gradlew && cd android && ./gradlew build -x test - Missing packages or files mentioned - android/gradlew not found (No such file or directory). The Gradle wrapper script at android/gradlew is missing or not present in the build context. - Version mismatch info - None reported. The log shows base image gradle:jdk11 and Android SDK setup, but no explicit version mismatch errors.
FROM gradle:jdk11
# Build Spectrum Android native library from source using Gradle and CMake
# This container installs Android SDK/NDK and builds the project.
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
cmake \
&& rm -rf /var/lib/apt/lists/*
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin
# Install Android command-line tools (sdkmanager) and set up PATH
RUN mkdir -p ${ANDROID_SDK_ROOT} \
&& cd ${ANDROID_SDK_ROOT} \
&& curl -fsSL -o /tmp/commandlinetools-linux_latest.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip \
&& unzip -qq /tmp/commandlinetools-linux_latest.zip -d /tmp/cmdline-tools \
&& mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools/latest \
&& mv /tmp/cmdline-tools/cmdline-tools/* ${ANDROID_SDK_ROOT}/cmdline-tools/latest/ \
&& rm -rf /tmp/commandlinetools-linux_latest.zip /tmp/cmdline-tools
RUN ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
RUN ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager \
"platform-tools" \
"platforms;android-33" \
"build-tools;33.0.2" \
"ndk;23.1.7779620"
# Set work directory and copy source
WORKDIR /workspace
COPY . /workspace
# Build the Android project with Gradle wrapper (use Gradle from the image if wrapper is missing)
RUN chmod +x android/gradlew \
&& cd android \
&& ./gradlew build -x test || gradle build -x test
# Final runtime container setup
# This image is intended for building; artifacts are in android/
CMD ["bash"]
Build status: - VerifyBuild status: build_failed General concerns: - sdkmanager --licenses is not auto-accepted in non-interactive Docker builds; this can cause the build to fail if licenses are not accepted automatically. - The commandlinetools URL and exact version used may change over time; image should be periodically updated or pinned. - COPY . /workspace may copy large or unnecessary files (local caches, secrets); add a .dockerignore to avoid bloat and security risks. Failing command/step: - RUN chmod +x android/gradlew && cd android && ./gradlew build -x test || gradle build -x test Exact error messages (preserved): - chmod: cannot access 'android/gradlew': No such file or directory - BUILD FAILED in 30s (Gradle errors follow) - 1: Task failed with an exception. - Where: - Build file '/workspace/android/build.gradle' line: 53 - What went wrong: - A problem occurred evaluating project ':android'. - > Could not set unknown property 'classifier' for task ':android:sourcesJar' of type org.gradle.api.tasks.bundling.Jar. - 2: Task failed with an exception. - What went wrong: - A problem occurred configuring project ':android'. - > Invalid MavenPublish Configuration. Unable to find variant to publish named release. Try setting the 'androidVariantToPublish' property in the mavenPublish extension object to something that matches the variant that ought to be published. - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. - For more on this, please refer to https://docs.gradle.org/8.14.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. Missing packages / files mentioned: - android/gradlew (missing, causing the initial chmod failure) - Android SDK components blocked by license not accepted: - Android SDK Build-Tools 33.0.2 - Android SDK Platform 33 - Android SDK Platform-Tools - NDK (Side by side) 23.1.7779620 - The following packages can not be installed since their licenses or those of the packages they depend on were not accepted: - ndk;23.1.7779620 - build-tools;33.0.2 - platforms;android-33 - platform-tools License/SDK implications: - License prompt: Accept? (y/N): - Skipping following packages as the license is not accepted: - The license acceptance attempt resulted in NOT installing the above SDK components due to unaccepted licenses. Version / compatibility notes: - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - Gradle version referenced in logs: 8.14.4