sqlite-android icon indicating copy to clipboard operation
sqlite-android copied to clipboard

Support 16KB page size devices

Open mlewandowskipt opened this issue 1 year ago • 2 comments

In Android 15 support for 16KB page sizes has been announced.

However, libsqlite3x.so ELF segments are not aligned using 16 KB ELF alignment. This results in runtime crash when loading libsqlite3x.so on emulator that is configured to use 16KB page size:

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~-4biVEV5Nsst_51cMfx4Rg==/com.myapp-UApKSN3Ka7mJzUoGgCsMEg==/base.apk!/lib/arm64-v8a/libsqlite3x.so" (new hash type from the future?)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1081)
    at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
    at java.lang.System.loadLibrary(System.java:1765)
    at io.requery.android.database.sqlite.SQLiteDatabase.<clinit>(Unknown Source:2)
    at io.requery.android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(Unknown Source:95)
    at io.requery.android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SourceFile:3)
    at io.requery.android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SourceFile:1)

This can also be verified by preparing and running alignment.sh script as described in the documentation.

The solution is to compile libsqlite3x.so with 16KB ELF alignment as described here.

mlewandowskipt avatar Jul 30 '24 09:07 mlewandowskipt

https://github.com/requery/sqlite-android/pull/203 fixes this issue. I updated to version 3.49.0 and was able to successfully run on a "16 KB Page Size" Android emulator. I believe this can be closed now. Thank you!

adrian-niculescu avatar Jul 02 '25 11:07 adrian-niculescu

Having issues with this building in unity 2022.3.59f1 ERROR:/Users/sssss/.gradle/caches/transforms-3/dd1aeef93cbddb7366f2db823c9ebd45/transformed/core-1.15.0-runtime.jar: D8: java.lang.NullPointerException

tachubgame avatar Sep 16 '25 13:09 tachubgame