Android loadLibrary - dlopen failed

The library: libcutils.so was working fine till Android Marshmallow (Android 6 (SDK 23)).

But my application run on the device with Android Oreo (Android 8 (SDK 26)), get the crash as follow.

java.lang.UnsatisfiedLinkError: dlopen failed: library “/system/lib/libcutils.so”
is not accessible for the namespace “classloader-namespace”

Because Android Nougat (Anroid 7 (SDK 24)) is not currently supported by the Creative SDK.

We got several solutions on the Internet.

Edit system/etc/public.libraries.txt

Add third party library in public.libraries.txt.

But this solution is failed on my device.

Read library from vendor lib

Add third party library in vendor/lib.

This solution is success.

Device manufactures

Android 9 support device manufactures, it can push third party library in system/lib.
But I didn’t have this device, not tested yet.

In this solution, we must change the library name. ( lib*COMPANYNAME.so)
Ex: libgstreamer.so change to libgstreamer.qisda.so

And add file: public.libraries-COMPANYNAME.txt in system/etc/

Reference

source.android.com

Author

Nick Lin

Posted on

2019-03-27

Updated on

2023-01-18

Licensed under


Comments