I have created a sample project that uses Crypto++'s native C++ Libraries and the NDK to generate some ECDH key pairs. You can find the project here.
This project runs perfectly fine on most android devices (ran on a handful of 4.4 and 5.0 devices). However I recently ran the app on a Nexus 5 and Nexus 7, both running Android 6.0.1, and the app crashed with the following error.
java.lang.UnsatisfiedLinkError: dlopen failed: library "./obj/local/armeabi-v7a/libcryptopp.so" not found
I am not really sure what is going on here, as the project obviously has these files, and they should be fine. This seems like it might be some sort of NDK related issue but I am not really sure.
I tried removing the armeabi-v7a folder, which forced the app to use the armeabi files on the Nexus Devices, but it could not find those files either.
I opened up the apk and all of the correct .so files are in there with the appropriate folders.
Not really sure if this is an Android Marshmallow issue, a Nexus architecture issue, or some .so file compile issue. I am new to using the NDK so would appreciate ideas on where to look to fix this.
EDIT: After looking into it a little more looks like this is an Android Marshmallow issue. A related issue was mentioned here. Changing my targetSdkVersion
to 22
"fixes" the crash. But obviously this is not a very future friendly fix.
Apparently on Android Marshmallow, they switched from OpenSSL to BoringSSL. This is probably the root issue, as I would imagine Crypto++ uses functionality from OpenSSL and links against it?
Still looking around for an actual fix that lets me targetSdkVersion 23
. Will probably try out some of the solutions listed in this article and see what happens.
EDIT 2: Crypto++ does not link against OpenSSL so there goes that theory. Help here is still appreciated.