Skip to content

Commit 6785a55

Browse files
committed
Document minimum Android API 28 in README and CLAUDE.md
posix_spawn* (used by mtmd-helper.cpp via subprocess.h) is only declared in NDK headers when __ANDROID_API__ >= 28, making Android 9.0 Pie the minimum supported version. Add an explicit note to the README [!NOTE] block, the "Importing in Android" section, and a new CLAUDE.md section that mirrors the CUDA version pattern with upgrade instructions. https://claude.ai/code/session_01RcJfwgM2cfjd3n5A8JrGqe
1 parent c6bb70d commit 6785a55

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ git add .github/build_cuda_linux.sh pom.xml CLAUDE.md
3838
git commit -m "Upgrade CUDA from 13.2 to 13.3"
3939
```
4040

41+
## Android minimum API level
42+
43+
Current Android minimum API level: **28** (Android 9.0 Pie)
44+
45+
To change the minimum API level, update the following **three** places:
46+
47+
1. **`CMakeLists.txt`** — the `add_compile_definitions(__ANDROID_API__=28)` line (controls which NDK header symbols are exposed).
48+
2. **`.github/workflows/publish.yml`**`-DANDROID_PLATFORM=android-28` in both the `crosscompile-android-aarch64` and `crosscompile-android-aarch64-opencl` job steps.
49+
3. **`CLAUDE.md`** (this file) — the "Current Android minimum API level" line above and the `-DANDROID_PLATFORM` values in the local sanity-build examples.
50+
51+
Also update the minimum-API note in **`README.md`** (the `[!NOTE]` block near the Android classifier entries and the "Importing in Android" section).
52+
53+
**Why API 28?** `mtmd-helper.cpp` (part of the upstream llama.cpp `mtmd` multimodal library) includes `vendor/sheredom/subprocess.h`, which calls `posix_spawn`, `posix_spawnp`, and `posix_spawn_file_actions_*`. The Android NDK headers only expose those declarations when `__ANDROID_API__ >= 28`. The symbols exist in `libc.so` at all API levels; the define only gates their header visibility.
54+
4155
## OpenCL / Adreno backend on Android
4256

4357
A second Android arm64 artifact is built with the OpenCL backend enabled and

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ Pick at most one — they are mutually exclusive.
202202
> by the released artifacts; building from source via the
203203
> `.github/dockcross/dockcross-android-arm` toolchain is possible but not
204204
> wired into CI.
205+
>
206+
> The minimum required Android version is **API 28 (Android 9.0 Pie)**.
207+
> Devices running Android 8.1 (API 27) or earlier are not supported.
205208
206209
### Setup required
207210

@@ -506,6 +509,10 @@ The `LogLevel` enum values passed to the callback correspond to the native llama
506509

507510
## Importing in Android
508511

512+
> [!IMPORTANT]
513+
> **Minimum Android version: API 28 (Android 9.0 Pie).** Devices running
514+
> Android 8.1 (API 27) or earlier are not supported.
515+
509516
You can use this library in Android project.
510517
1. Add java-llama.cpp as a submodule in your an droid `app` project directory
511518
```shell

0 commit comments

Comments
 (0)