Status Update
Comments
da...@google.com <da...@google.com> #2
Thanks for trying out Room KMP! This looks like an issue with Android 9+ and armv7 and the way we compile sqlite3.c, specifically linking to the atomic library in C. We'll try to get this fix as soon as possible.
da...@google.com <da...@google.com> #3
ad...@ally.rapido.bike <ad...@ally.rapido.bike> #4
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit cf121571aac008a756b64cda13f76ae4db3e85a6
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed May 29 11:14:42 2024
Link to Android's atomic lib in bundled SQLite
Fix Bundled SQLite loading for devices with older ARM architecture by linking to Android's atomic library instead of relying on Clang's extension (c_atomic) or GCC's built-ins as used in sqlite3.c.
Also add support for passing linker args to androidx's native compilation infra.
See also discussion in
Bug: 341639198
Test: Locally tested via BundledSQLiteDriverTest in a Nexus 5 on API 23
Change-Id: Ia818b7c4f1a990a1b5e35f4c7a3c89694aee0503
M buildSrc/private/src/main/kotlin/androidx/build/clang/ClangSharedLibraryTask.kt
M buildSrc/private/src/main/kotlin/androidx/build/clang/KonanBuildService.kt
M buildSrc/private/src/main/kotlin/androidx/build/clang/MultiTargetNativeCompilation.kt
M buildSrc/private/src/main/kotlin/androidx/build/clang/NativeTargetCompilation.kt
M sqlite/sqlite-bundled/build.gradle
da...@google.com <da...@google.com>
bo...@gmail.com <bo...@gmail.com> #6
I'm using androidx.room:room-runtime-android:2.7.0-alpha01.
This is the log:
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myproject-ssibkzVuLAo7tvV0puYoEg==/base.apk"],nativeLibraryDirectories=[/data/app/com.myproject-ssibkzVuLAo7tvV0puYoEg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsqliteJni.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at androidx.sqlite.driver.bundled.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.android.kt:1)
at androidx.sqlite.driver.bundled.BundledSQLiteDriver.<clinit>(BundledSQLiteDriver.jvmAndroid.kt:1)
Thank you!
da...@google.com <da...@google.com> #7
Can you try using androidx.room:room-runtime-android:2.7.0-alpha04
and confirm if the issue is still present?
bo...@gmail.com <bo...@gmail.com> #8
da...@google.com <da...@google.com> #9
Ideally you could use AndroidSQLiteDriver
but Room has a bug with the AndroidSQLiteDriver
that is fixed in version 2.7.0-alpha05 that will be released in July 10 so I recommend that if you do switch to using AndroidSQLiteDriver
wait for the alpha05 release.
ro...@gmail.com <ro...@gmail.com> #10
I just received two errors from Crashlytics using androidx.sqlite:sqlite-bundled version 2.5.0-alpha06 and BundledSQLiteDriver for both Android and iOS.
Fatal Exception: java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/app/com.example.app-ACdqnxIlCwzIlzMdaeegRw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.app-ACdqnxIlCwzIlzMdaeegRw==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsqliteJni.so"
And the exception is in .setDriver(BundledSQLiteDriver())
Both crashes were from a Nexus 5X running Android 8.1.0
I would say it is the same exception as in
ev...@due.network <ev...@due.network> #11
f2...@gmail.com <f2...@gmail.com> #12
Same crash on Pixel 6 Pro(android12),Nexus 5X(android8.1) on androidx.sqlite:sqlite-bundled version 2.5.0-alpha11 with room version 2.7.0-alpha11.
ke...@level.co <ke...@level.co> #13
androidx.sqlite:sqlite-bundled version 2.5.0-alpha11 with room version 2.7.0-alpha11
da...@google.com <da...@google.com> #14
For those experiencing this issue, can you provide any more detail: stacktrace, bug report, trends (specific API versions, specific manufacturer)?
Usually with UnsatisfiedLinkError
there is more in the logs / error mentioning why the native library couldn't be used, specifically the missing symbol. I have so far validated we are
ki...@protonmail.com <ki...@protonmail.com> #15
Same crash on Pixel 6 pro
androidx-room = "2.7.0-alpha11"
androidx-sqlite = "2.5.0-alpha11"
Attached a stack trace
da...@nutrium.com <da...@nutrium.com> #16
Does anyone knows if it's safe to use AndroidSQLiteDriver for android as a backup plan?
We also released the iOS app some weeks ago and until know we didn't catch any issue related to this.
da...@google.com <da...@google.com> #17
For the stacktrace in jni/<abi>/libsqliteJni.so
da...@nutrium.com <da...@nutrium.com> #18
We have the structure like in the screenshoot
Description
I created an Android app using Room (Kotlin Multiplatform) and distributed it on the Play Store. Crashlytics reported that some Android devices were failing to instantiate the BundledSQLiteDriver.
Here is the stack trace.
I did not reproduce the above error on my Pixel 4a/Android 13.
Sample project to trigger the issue.
I created a sample project with a configuration similar to the production application where the error occurred.
Line where the error occurred.
Devices with error reported by Crashlytics