Currently the SQLCipher library does not have ndk support for 64bit cpu architecture on the Android devices and crashes; As we’d like to enable full 64bit support on our apps for newer devices like the S6, we would like to request an enhancement on the SQLCipher library for this support. Are there already plans to do so?
This sample app works perfectly fine on a Nexus 9, which has an arm64 CPU. 64-bit CPUs should gracefully degrade to using NDK binaries for 32-bit architectures. While there may be advantages to having 64-bit binaries for SQLCipher, you cannot make a blanket statement that SQLCipher crashes on 64-bit CPUs in its present form.
Thanks for the reply! And I apologize for not being clear in the previous post, I didn’t mean to use the crash as a blanket statement.
To be more specific, when building a universal ndk app, if there is at least one library in the app that has 64bit ndk, we see that Android expects all other libraries to support 64bit, hence the crash. We currently have a workaround for this by using the abiFilter to filter out the 64bit native code from the apk during build time, but would like to enable full support for 64bit architectures in the near future.
While there is a pending pull request to add both arm64v8a and x86_64 support to SQLCipher for Android, we are still awaiting integration [2] from OpenSSL directly on these specific platforms before we can continue with the merge. We are unaware of the priority the OpenSSL team has on adding direct support for those platforms within their build process. As soon as that becomes available we will revisit adding support to SQLCipher for Android.
That said, as @commonsguy mentioned, the 32 bit binaries will continue to work on a 64 bit device, however you can not include any other 64 bit binaries within the application. We look forward to expanding further platform support for SQLCipher for Android, however we need OpenSSL to officially support those platforms first.
I would like to add, I would recommend that you communicate your interest for 64 bit Android support to the OpenSSL team via the existing pull request, and/or through the OpenSSL mailing list. Increasing awareness of the interest in those platforms may help to drive support. Thanks!
Thank you Nick for the quick response on this and the info on the pending pull request with openSSL! We will continue to use the 32 bit binaries for now and will also drop a comment on OpenSSL regarding the 64 bit support! Thanks!
Just debugging this issue with our StoryMaker app, and we discovered that your wonderful cwac-anddown library contains a native arm64 binary that is triggering this crash with SQLCipher. I guess we can rebuild it without that target.
I just wanted to emphasize here both how tricky it can be to discover the source of this crash, since it is often not clear when a third-party library is taking advantage of 64-bit native code.
SQLCipher for Xamarin Android has a dependency on OpenSSL which did not previously build on 64-bit Android CPU’s without modification of their build system. OpenSSL 1.1.0 was just released near the end of last month. That release should include expanded support for the Android platform. With our next SQLCipher release we will investigate the Android support found within the latest OpenSSL release. Thanks!
We do not have a date for the next SQLCipher release at this time. We tend to merge the latest upstream SQLite release within a SQLCipher release, along with stable OpenSSL changes. We often allow for a settling time with regard to SQLite to allow for any bugs to shake out from their release. The latest release of SQLite came out less than a month ago. We will announce new releases here when they become available.
Yes, The latest SQLCipher for Xamarin Android is based on SQLCipher core 3.4.0. SQLCipher for Xamarin Android works on both Android N and 64-bit devices; for the latter you must only select armeabi, armeabi-v7a, and x86 within the list of supported ABI’s within your project Options → Build → Android Build → Advanced tab.