OpenCV 16 KB page-size fix: upgrade to 5.0.0.1
Artifact org.opencv:opencv · measured 2026-10-01 · all libraries
fixed
OpenCV versions up to and including 5.0.0 that we measured ship 4 KB-aligned native libraries (offending for Google Play's 16 KB page-size requirement). The first measured aligned stable version is 5.0.0.1; the newest measured, 5.0.0.1, is aligned.
Per-major-line fixes
Different major versions have separate fix paths:
4.x: upgrade to4.12.05.x: upgrade to5.0.0.1
- Non-monotone history. An aligned stable release exists before a later offending one (parallel release lines or backports). A higher version number does not guarantee alignment: pick your exact version and measure it. The version below is only the lowest aligned stable version above the highest offending one.
- NON-MONOTONE: an aligned release can be followed by an offending one; do not assume newer is safe. Per-release-line guidance: 4.x -> use measured aligned 4.12.0 (after offending 4.11.0); 5.x -> use measured aligned 5.0.0.1 (after offending 5.0.0). Re-run the checker on the version you resolve
- Sampled, not exhaustive: 9 of 9 published versions were measured with native code; unmeasured versions in between are unknown.
Measured evidence
| Version | Library file | p_align | File date | Source | |
|---|---|---|---|---|---|
| Last offending | 5.0.0 | jni/x86_64/libc++_shared.so | 4 KB (2^12) | Thu, 11 Jun 2026 06:34:30 GMT | artifact |
| First aligned | 5.0.0.1 | prefab/modules/opencv_java5/libs/android.x86_64/libopencv_java5.so | 16 KB (2^14) | Fri, 26 Jun 2026 15:10:30 GMT | artifact |
p_align is the smallest PT_LOAD segment alignment of the ELF. 16 KB-compatible needs at least 16384 (2^14). Method: min PT_LOAD p_align of arm64-v8a/x86_64 .so inside the published AAR/JAR; aligned = >=16384 for every lib. Dates are repository file times, not official release dates.
Offending versions measured (5)
4.9.0, 4.10.0, 4.10.0-kleidicv, 4.11.0, 5.0.0
Native libraries seen: libc++_shared.so, libopencv_java4.so, libopencv_java5.so.
The Gradle change
implementation("org.opencv:opencv:5.0.0.1")an aligned version, lowest measured above the last offending one; newer measured versions are aligned too (latest 5.0.0.1). Check: ./gradlew :app:dependencyInsight --dependency opencv --configuration releaseRuntimeClasspath // NON-MONOTONE: an aligned release can be followed by an offending one; do not assume newer is safe. Per-release-line guidance: 4.x -> use measured aligned 4.12.0 (after offending 4.11.0); 5.x -> use measured aligned 5.0.0.1 (after offending 5.0.0). Re-run the checker on the version you resolve
Confirm what Gradle actually resolves, since another dependency may pull an older version:
./gradlew :app:dependencyInsight --dependency opencv --configuration releaseRuntimeClasspathRe-verify it yourself
Download the artifact and run the free checker (check16k.py, Python 3, no dependencies):
curl -LO https://repo1.maven.org/maven2/org/opencv/opencv/5.0.0.1/opencv-5.0.0.1.aar
python3 check16k.py opencv-5.0.0.1.aarExit 0 = aligned, 1 = an unaligned library found. Better still, run it on your final .aab/.apk.
The paid kit ($12, v2) contains the complete measured fix map for all 80+ libraries as JSON and a table, every raw per-version measurement, the spot-check evidence, and the step-by-step guide for Play's 16 KB requirement. This page and the checker script stay free.
Get the kit ($12)Related artifacts
- OpenCV (quickbirdstudios) (com.quickbirdstudios:opencv)