Context
Summary
Android 17 shows this compatibility warning when launching the dev build on Pixel 10 Pro:
This app isn't 16 KB-compatible. RELRO alignment check failed.
The APK is already built with 16 KB PT_LOAD alignment and passes APK zip alignment. The remaining failure is PT_GNU_RELRO alignment in packaged native libraries from external and Synonym artifacts.
Repro Context
adb shell getconf PAGE_SIZE
# 4096
The warning appeared on a 4 KB page-size device, so the app still runs there. The APK must still pass the stricter Android 17 compatibility checks before release.
APK inspected:
app/build/outputs/apk/dev/debug/bitkit-dev-debug-182-universal.apk
Baseline checks that already passed:
arm64-v8a PT_LOAD alignment: >= 0x4000
zipalign -v -c -P 16 4 bitkit-dev-debug-182-universal.apk: Verification successful
Failing Libraries
libandroidx.graphics.path.so RELRO end=0x6000 source: androidx.graphics:graphics-path:1.0.1
libdatastore_shared_counter.so RELRO end=0xd000 source: androidx.datastore:datastore-core-android:1.2.0
libpaykit.so RELRO end=0x859000 source: com.synonym:paykit-android:0.1.0-rc8
libsurface_util_jni.so RELRO end=0x5000 source: androidx.camera:camera-core:1.5.2
Checked native libraries that passed in this APK:
libbitkitcore.so
libldk_node.so
libvss_rust_client_ffi.so
libjnidispatch.so
libbarhopper_v3.so
libimage_processing_util_jni.so
Requirements
External Dependencies
Synonym Artifacts
Bitkit Validation
Acceptance Criteria
Verification Commands
Use artifact checks as the source of truth. The Android dialog can be suppressed per install/device state.
APK=app/build/outputs/apk/dev/debug/bitkit-dev-debug-*-universal.apk
NDK_READELF="$ANDROID_HOME/ndk/28.1.13356709/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf"
ZIPALIGN="$ANDROID_HOME/build-tools/35.0.0/zipalign"
"$ZIPALIGN" -v -c -P 16 4 $APK
rm -rf /tmp/bitkit-16kb-check
mkdir -p /tmp/bitkit-16kb-check
unzip -q $APK 'lib/arm64-v8a/*.so' 'lib/x86_64/*.so' -d /tmp/bitkit-16kb-check
python3 - <<'PY'
import pathlib
import subprocess
import sys
readelf = pathlib.Path.home() / 'Library/Android/sdk/ndk/28.1.13356709/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf'
root = pathlib.Path('/tmp/bitkit-16kb-check/lib')
failed = False
for so in sorted(root.glob('*/*.so')):
out = subprocess.check_output([str(readelf), '-l', str(so)], text=True)
for line in out.splitlines():
parts = line.split()
if not parts:
continue
if parts[0] == 'LOAD':
align = int(parts[-1], 16)
if align < 0x4000:
print(f'FAIL LOAD {so}: align=0x{align:x}')
failed = True
if parts[0] == 'GNU_RELRO':
vaddr = int(parts[2], 16)
memsz = int(parts[5], 16)
end = vaddr + memsz
if end % 0x4000 != 0:
print(f'FAIL RELRO {so}: end=0x{end:x}')
failed = True
if failed:
sys.exit(1)
print('16 KB native compatibility checks passed')
PY
Fresh-install runtime check:
adb uninstall to.bitkit.dev || true
adb install app/build/outputs/apk/dev/debug/bitkit-dev-debug-*-universal.apk
adb shell monkey -p to.bitkit.dev -c android.intent.category.LAUNCHER 1
16 KB environment check:
adb shell getconf PAGE_SIZE
# expected: 16384
Context
Summary
Android 17 shows this compatibility warning when launching the dev build on Pixel 10 Pro:
The APK is already built with 16 KB
PT_LOADalignment and passes APK zip alignment. The remaining failure isPT_GNU_RELROalignment in packaged native libraries from external and Synonym artifacts.Repro Context
adb shell getconf PAGE_SIZE # 4096The warning appeared on a 4 KB page-size device, so the app still runs there. The APK must still pass the stricter Android 17 compatibility checks before release.
APK inspected:
Baseline checks that already passed:
Failing Libraries
Checked native libraries that passed in this APK:
Requirements
External Dependencies
androidx.datastore:datastore-preferencesfrom1.2.0to1.2.1.libdatastore_shared_counter.sopasses the RELRO check after the bump.androidx.graphics:graphics-pathversion wherelibandroidx.graphics.path.sopasses the RELRO check.libsurface_util_jni.sopasses the RELRO check.Synonym Artifacts
com.synonym:paykit-androidfrom source with the current Android native build pipeline and NDKr28or newer.libpaykit.sopasses the check.com.synonym:paykit-android:0.1.0-rc8to the fixed Paykit release.libpaykit.sopasses the RELRO check in the rebuilt Bitkit APK/AAB.bitkit-core,ldk-node,vss-client, and other native artifacts.Bitkit Validation
scripts/check-16kb-compat.shor equivalent.PT_LOADalignment below0x4000onarm64-v8aandx86_64libraries.PT_GNU_RELROend addresses not aligned to0x4000onarm64-v8aandx86_64libraries.zipalign -v -c -P 16 4.Acceptance Criteria
scripts/check-16kb-compat.shpasses for the dev debug universal APK.scripts/check-16kb-compat.shpasses for release APK/AAB artifacts used for distribution.Verification Commands
Use artifact checks as the source of truth. The Android dialog can be suppressed per install/device state.
Fresh-install runtime check:
16 KB environment check:
adb shell getconf PAGE_SIZE # expected: 16384