Open danmov26 opened 1 year ago
Hi @danmov26,
You need to perform the following to load the native library prior to invoking any SQLCipher-related API, including Room support:
System.loadLibrary("sqlcipher");
Good day, @developernotes. Today I got error from System.loadLibrary("sqlcipher");
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.financialaccounting.fincircle-1/base.apk"],nativeLibraryDirectories=[/data/app/com.financialaccounting.fincircle-1/lib/x86_64, /system/lib64, /vendor/lib64]]] couldn't find "libsqlcipher.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1001)
at java.lang.System.loadLibrary(System.java:1562)
at com.financialaccounting.fincircle.functions.ReleaseFunctionsKt.initDatabases(ReleaseFunctions.kt:64)
at com.financialaccounting.fincircle.App.onCreate(App.kt:135)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5408)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6124)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:890)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:780)
com.financialaccounting.fincircle.functions.ReleaseFunctionsKt.initDatabases: And it calls in Application class in onCreate method:
sqlite = try {
System.loadLibrary("sqlcipher")
Room.databaseBuilder(this, AppDatabase::class.java, getIStr(getStr(R.string.sufe6rFN0)))
.addMigrations(*AppDatabase.ALL_MIGRATIONS)
.allowMainThreadQueries()
.openHelperFactory(SupportFactory(SQLiteDatabase.getBytes(getIStr(getStr(R.string.FCb4XhxRv)).toCharArray())))
.build()
} catch (e: Exception) {
//
}
My app - https://play.google.com/store/apps/details?id=com.financialaccounting.fincircle P.S. VPN Russia or Great Britain needed to install.
Please, help me
Hi @danmov26
Is this issue occurring intermittently, or for all users? If it's intermittent, you might look into utilizing the ReLinker project. We received positive reports from other users who previously experienced java.lang.UnsatisfiedLinkError
.
Hi @developernotes Intermittent. Only from this Galaxy Tab A, Android 7.1.2.
Ok. Thanks for offer. But by the way, in the Relinker page they write that if min sdk >= 23 (for my app it's true), then System.loadLibrary
is safe. Anyway, ok. I'll try it.
Hi @danmov26.
The stracktrace you shared indicates (based on the fact that package has been renamed from net.sqlcipher.database
to net.zetetic.database.sqlcipher
in this repository and also SupportFactory
has been renamed to SupportOpenHelperFactory
) that you are using the original android sqlcipher library. Please see a very similar problem that might help you.
I also ran into this problem. I found out that this exception is due to the fact that 4.3.0 and later versions of sqlcipher no longer support 32-bit architecture. At present, there are still many Android phones that use 32-bit so libraries. Can you continue to support them?
Hello @sunzhk,
That is incorrect. SQLCipher for Android supports armeabi-v7a, x86, x86_64, and arm64_v8a architectures. Both armeabi-v7a and x86 are 32-bit architectures.
Hi @developernotes I'm so sorry, I made a mistake. I didn't make it clear, what I want is support of the armabi platform。 For some reason our app doesn't support armeabi-v7a. Is there any way to get support for armeabi?
Hi @sunzhk,
The Android NDK removed support for ARMv5 (armeabi) in NDK r17 ^1, so that is no longer supported by the compiler toolchain.
Hi @developernotes :
Thank you very much for your answer. I will find a way to make our app support armeabi-v7a.
Thanks again!
Instead of System.loadLibrary, SplitInstallHelper.loadLibrary(context, "sqlcipher")
helped us in solving this problem
I already received 168 errors from IRBIS SP511 in Firebase Crashlytics. I use latest version 4.5.2. Help me, please.
This is how my app initilizes AppDatabase in Application class.