Skip to content

"libsqlcipher.so" not found - Only on Pixel 6 Pro Android 12 #60

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

Open
roudikk opened this issue May 26, 2025 · 1 comment
Open

"libsqlcipher.so" not found - Only on Pixel 6 Pro Android 12 #60

roudikk opened this issue May 26, 2025 · 1 comment

Comments

@roudikk
Copy link

roudikk commented May 26, 2025

Hello,
Our app just started receiving this exception on Crashlytics:

Fatal Exception: java.lang.UnsatisfiedLinkError
dlopen failed: library "libsqlcipher.so" not found

This started to happen suddenly on different app versions. The code of loading sqlcipher hasn't changed. We did recently update to 4.8 but the crash was also happening on other app versions that had different versions of sqlcipher.

It's not happening to all our users, but it's 100% just on Pixel 6 Pro running Android 12. (About 80~ users)

The lib folder generated (Both in aab and apks generated from that aab for Pixel 6 Pro) contain the libsqlcipher.so file for the right target (arm64-v8a) and other targets.

We got a Pixel 6 pro, rolled back to Android 12 and couldn't reproduce the issue.

We saw many instances in the github issues over here where people mentioned using ReLinker or SplitInstallHelper, so we released a version that does the following:

private fun loadInSqlCipher(context: Context) {
    val sqlCipherLibraryName = "sqlcipher"
    try {
        System.loadLibrary(sqlCipherLibraryName)
    } catch (throwable: Throwable) {
        try {
            SplitInstallHelper.loadLibrary(context, sqlCipherLibraryName)

            // send log that indicates that this worked through SplitInstallHelper
        } catch (throwable: Throwable) {
            ReLinker.loadLibrary(context, sqlCipherLibraryName)

            // send log that indicates that this worked through ReLinker
        }
    }
}

But unfortunately the same amount of crashes happening before is still happening but with a different trace since now ReLinker is the last resort:

Could not find 'libsqlcipher.so'. Looked for: [arm64-v8a, armeabi-v7a, armeabi], but only found: [].

Unfortunately I couldn't replicate this at all so can't provide any code snippet.

Any help would be appreciated.

@developernotes
Copy link
Member

Hi @roudikk,

From this AGP release note 1, if you haven't tried this yet, it might be worth disabling this to see if the behavior changes.

android.bundle.enableUncompressedNativeLibs = false

Footnotes

  1. https://developer.android.com/build/releases/past-releases/agp-3-3-0-release-notes#:~:text=When%20building%20an%20Android%20App,android.bundle.enableUncompressedNativeLibs%20=%20false

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

2 participants