Android M crash java.lang.UnsatisfiedLinkError: dlopen failed:

My Android application crashes and gives me the following error message: `java.lang.UnsatisfiedLinkError: dlopen failed: cannot be found

+6
source share
6 answers

This is due to the switch of Android 6.0 (Marshmallow) from OpenSSL to BoringSSL.

Your exception occurs in the library reference code. Contact your vendor for a fix or manually enable the OpenSSL libraries to avoid the problem.

Also see: https://sourcedna.com/blog/20150806/predicting-app-crashes-on-android-m.html

+2
source

The crash is due to the following fact, which has been changed in Android M

β€œIn previous versions of Android, if your application required the system to load a shared library with moving text, the system issued a warning, but still allowed to load the library. Starting with this version, the system rejects this library if your target version of the SDK for your application is 23 or higher.To help you determine if the library is loaded, your application should report a dlopen (3) crash and include a problem description text that dlerror (3) returns. For information on handling text movements, see this guide state "

for more information see link

+14
source

First of all, I must say that I do not understand all the features of this subject, but I will try to lead you along the path that helped me.

I saw that this problem only appeared when using the target version as 23. Reading the other messages was easy to determine that this happened with libraries compiled with the old ndk tools (ndk -build, to be more specific, but I don’t know exactly whether this tool appeared later to meet new needs).

This happened to me using libiconv, a dependency on the ZBar project . So I thought that recompiling would help and will help. I used the ndk-build tool to recompile zbar and iconv libs.

I hope this is enough.

+3
source

as a simple answer, you just need to configure Android sdk 22 sdk instead of android 23 in your build configuration. For example, using gradle use:

defaultConfig { targetSdkVersion 22 } 
+2
source

Try changing targetSdkVersion in build.gradle to 22 and APP_PLATFORM := android-22 in application.mk . It worked in my environment.

+1
source

I could get it to work in later SdkVersions by adding the following line to the NDK in the gradle script

 android.ndk { <...> //rest of lines cppFlags.add("-fPIC") //generate position independent code <...> } 
0
source

All Articles