Android 16 (SDK 36) introduces, and enforces, 16 KB page size compatibility to improve performance, causing crashes (e.g.,
SIGBUS, dlopen failed) in apps using native SQLCipher or SQLite libraries built with 4 KB alignment. The fix requires updating native SQLite dependencies to be 16 KB aligned using NDK r27+, AGP 8.5.1+, and 16 KB alignment flags.
Key 16 KB Page Size SQLite Problems & Solutions
Native Library Incompatibility: Apps using native SQLite binaries (.so files) that are 4 KB-aligned (Align 0x1000) will crash on Android 16, which requires 16 KB alignment (Align 0x4000).
Fixing Native Libraries: Update to native libraries (such as libsqlite3x.so) that are compiled with 16 KB ELF alignment.
Android NDK Requirement: Update to NDK r27c or higher to ensure proper 16 KB alignment during build.
Database File Incompatibility: SQLite database files created with a 4 KB page size might face performance issues or potential read/write errors on 16 KB devices, though usually, only native binary alignment causes outright crashes.
Workaround: For immediate issues, use android:pageSizeCompat in your AndroidManifest.xml to allow older apps to run on 16 KB devices, although this is not a permanent solution.