Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsatisfiedLinkError: ...couldn't find "libsqlcipher.so" on IRBIS SP511 #8

Open
danmov26 opened this issue Dec 2, 2022 · 11 comments
Open

Comments

@danmov26
Copy link

danmov26 commented Dec 2, 2022

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/arm, /system/lib, /vendor/lib, /system/vendor/lib]]] couldn't find "libsqlcipher.so"
       at java.lang.Runtime.loadLibrary0(Runtime.java:972)
       at java.lang.System.loadLibrary(System.java:1530)
       at net.sqlcipher.database.SQLiteDatabase$1.loadLibraries(SQLiteDatabase.java:227)
       at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:244)
       at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:223)
       at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:216)
       at net.sqlcipher.database.SupportHelper.<init>(SupportHelper.java:31)
       at net.sqlcipher.database.SupportFactory.create(SupportFactory.java:43)
       at com.financialaccounting.fincircle.data.AppDatabase_Impl.createOpenHelper(AppDatabase_Impl.java:269)
       at androidx.room.RoomDatabase.init(RoomDatabase.java:198)
       at androidx.room.RoomDatabase$Builder.build(RoomDatabase.java:1487)
       at com.financialaccounting.fincircle.functions.ReleaseFunctionsKt.initDatabases(ReleaseFunctions.kt:47)
       at com.financialaccounting.fincircle.App.onCreate(App.kt:149)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5503)
       at android.app.ActivityThread.-wrap2(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:203)
       at android.app.ActivityThread.main(ActivityThread.java:6251)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)

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.

sqlite = 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()
@developernotes developernotes transferred this issue from sqlcipher/sqlcipher Dec 2, 2022
@developernotes
Copy link
Member

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");

@danmov26
Copy link
Author

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)

Снимок экрана 2022-12-17 202942

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

@developernotes
Copy link
Member

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.

@danmov26
Copy link
Author

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.

@richardgarcar
Copy link
Contributor

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.

@sunzhk
Copy link

sunzhk commented Mar 31, 2023

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?

@developernotes
Copy link
Member

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.

@sunzhk
Copy link

sunzhk commented Apr 13, 2023

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?

image

@developernotes
Copy link
Member

Hi @sunzhk,

The Android NDK removed support for ARMv5 (armeabi) in NDK r17 1, so that is no longer supported by the compiler toolchain.

Footnotes

  1. https://developer.android.com/ndk/guides/abis#sa

@sunzhk
Copy link

sunzhk commented Apr 14, 2023

Hi @developernotes :

Thank you very much for your answer. I will find a way to make our app support armeabi-v7a.

Thanks again!

@UKMIITB
Copy link

UKMIITB commented Jan 16, 2024

Instead of System.loadLibrary, SplitInstallHelper.loadLibrary(context, "sqlcipher") helped us in solving this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants