Hi, I am using SQLCipher 3.5.2 in my Android project. It works perfectly well on devices of version 5.0 and lower. But it throws an exception with devices of version 5.1 onwards. It fails to execute SQLiteDatabase.loadLibs(context) and gives an UnsatisfiedLinkError. I added the library as follows in build.gradle file (using Android Studio):
Are you able to reproduce the error on your devices when you run the SQLCipher for Android test suite? Are you possibly including other 64 bit third-party native libraries within your application? If so, SQLCipher for Android does not support that, here are the details.
The test suite is keep in lock step with the compatibility section of SQLCipher for Android. I will update the README within the test suite to reflect that correctly.
We look forward to hearing your results of the test suite on the device(s) you are experiencing crashing behavior.
Do you have steps to import the SQLCipher test suite to Android Studio? I am facing multiple issues after importing it. Or if there is any other way I can run these tests on my device without having to build them in Studio?
I ran the test suite on the devices on which I am getting crashes in my app. The results were all “OK” (although I could see some exceptions in their logs, not sure if they are irrelevant if all the tests are OK)
What does that suggest?
Also, correct me if I am wrong: On your query above
Shouldn’t the application crash on all the devices(instead of selected ones) if we are using any other 64 bit 3rd party native lib?
I’m glad to hear the issue does not appear to be with SQLCipher for Android itself, however could be related to your third-party libraries being included within the application. The exceptions are possible side effects of various tests. Further analysis of your application dependencies would need to occur.
No, in the event that your run your application on a 32-bit CPU, Android would not attempt to load native libraries from the x86_64, or arm64 folders, however that is not the case in a 64-bit scenario. Are you certain that you are not including any third-party libraries that include 64-bit versions of their native library?
Thanks for your suggestions. I think the problem was that of 64-bit versions that other libraries may be creating. I fixed the issue by following your suggestion in this link SQLCipher for Android - Native Library Support. Added “split” property to my gradle file.
I just resolved my issue with “split” in my gradle. But this fix creates multiple APKs. But I need 1 APK which I can use for all the devices and which also resolves the issue. Multiple APKs cannot be released for 1 application. Isn’t there any way that can be done?