Android 16 KB fix map

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:

Caveats

Measured evidence

VersionLibrary filep_alignFile dateSource
Last offending5.0.0jni/x86_64/libc++_shared.so4 KB (2^12)Thu, 11 Jun 2026 06:34:30 GMTartifact
First aligned5.0.0.1prefab/modules/opencv_java5/libs/android.x86_64/libopencv_java5.so16 KB (2^14)Fri, 26 Jun 2026 15:10:30 GMTartifact

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 releaseRuntimeClasspath

Re-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.aar

Exit 0 = aligned, 1 = an unaligned library found. Better still, run it on your final .aab/.apk.

Need the full map for every library, not just OpenCV?

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