JNA 16 KB page-size fix: upgrade to 5.16.0
Artifact net.java.dev.jna:jna · measured 2026-10-01 · all libraries
fixed
JNA versions up to and including 5.15.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.16.0; the newest measured, 5.19.1, is aligned.
- ARCHITECTURE-SPECIFIC: the last offending measurement 5.15.0 is x86_64-only; its arm64-v8a libraries are aligned
- Sampled, not exhaustive: 16 of 55 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.15.0 | jni/x86_64/libjnidispatch.so | 4 KB (2^12) | Sun, 15 Sep 2024 15:54:55 GMT | artifact |
| First aligned | 5.16.0 | jni/arm64-v8a/libjnidispatch.so | 16 KB (2^14) | Sun, 22 Dec 2024 10:08:29 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 (10)
4.5.0, 5.0.0, 5.2.0, 5.3.1, 5.6.0, 5.8.0, 5.10.0, 5.12.1, 5.14.0, 5.15.0
Native libraries seen: libjnidispatch.so.
The Gradle change
implementation("net.java.dev.jna:jna:5.16.0")an aligned version, lowest measured above the last offending one; newer measured versions are aligned too (latest 5.19.1). Check: ./gradlew :app:dependencyInsight --dependency jna --configuration releaseRuntimeClasspath // ARCHITECTURE-SPECIFIC: the last offending measurement 5.15.0 is x86_64-only; its arm64-v8a libraries are aligned
Confirm what Gradle actually resolves, since another dependency may pull an older version:
./gradlew :app:dependencyInsight --dependency jna --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/net/java/dev/jna/jna/5.16.0/jna-5.16.0.aar
python3 check16k.py jna-5.16.0.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)