Status Update
Comments
am...@google.com <am...@google.com>
ya...@google.com <ya...@google.com>
bo...@google.com <bo...@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.
ws...@gmail.com <ws...@gmail.com> #3
bo...@google.com <bo...@google.com> #4
ws...@gmail.com <ws...@gmail.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
ws...@gmail.com <ws...@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!
bo...@google.com <bo...@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...@google.com <bo...@google.com> #8
ws...@gmail.com <ws...@gmail.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.
bo...@google.com <bo...@google.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
ws...@gmail.com <ws...@gmail.com> #11
bo...@google.com <bo...@google.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.
ws...@gmail.com <ws...@gmail.com> #13
androidx.sqlite:sqlite-bundled version 2.5.0-alpha11 with room version 2.7.0-alpha11
bo...@google.com <bo...@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
ws...@gmail.com <ws...@gmail.com> #15
Same crash on Pixel 6 pro
androidx-room = "2.7.0-alpha11"
androidx-sqlite = "2.5.0-alpha11"
Attached a stack trace
bo...@google.com <bo...@google.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.
ws...@gmail.com <ws...@gmail.com> #17
For the stacktrace in jni/<abi>/libsqliteJni.so
bo...@google.com <bo...@google.com> #18
We have the structure like in the screenshoot
to...@gmail.com <to...@gmail.com> #20
tonyvg2013@gmail.com
Tony if you want to contact me for some questions or related topic it would be great.
I have been a whitness for the activity of my friends and others over 35 individual cases of the same MO.
Description
We're running the
emulator
CLI, using the latestAPI 30 AOSP ATD x86
image, on an x86_64 host, like this:/android-emulator-sdk/emulator/emulator -avd emulator-avd -no-boot-anim -read-only -verbose -no-window -sysdir ./system/x86 -system ./system/x86/system.img -ramdisk ./system/x86/ramdisk.img -qemu -enable-kvm
On emulator 31.2.10:
and the emulator starts successfully.
On emulator 31.3.10:
Eventually failing with this:
(Note: we pass the
-sysdir
arg explicitly, since our system images are not stored in the SDK directory.)Found AVD target architecture: arm, thus trying to run qemu-system-aarch64-headless, seems likely to be the root cause?