[Solved] Non-fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library “libmmkv.so“ not found

The mmkv model 1.0.23 used within the challenge is simply too outdated, and 1.0.23 additionally introduces libc++_shared.so which is about 249K + libmmkv.so which is about 40K.

Checking github, I found that the most recent model has reached 1.2.14 and the aar package deal has been optimized, so I’ve a have to improve.


Problem description

In the challenge, we upgraded mmkv model 1.0.23 to 1.2.14. After fixing a number of compilation errors (inconsistent kotlin variations, gradle improve required, and so forth.), we thought all the things was all proper, however we didn’t anticipate to report the startup

Non-fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library “libmmkv.so” not found

I searched varied posts on the Internet – no reply. Later, somebody in github challenge raised related questions: dlopen failed: library “libmmkv. so” not found · Issue # 958 · Tencent/MMKV · GitHub

Inspired, we developed the supply code GitHub – Tencent/MMKV: An efficient, small mobile key value storage framework by WeChat Works on Android, iOS, macOS, Windows, and POSIX. Clone down and examine.


Cause evaluation:

After compiling the mmkv module with the supply code clone, it’s found that solely the next 4 cpu structure sos will probably be generated within the compilation log

armeabi-v7a, arm64-v8a, x86, x86_64

No armeabi generated

Solved Non Fatal Exception Javalangunsatisfiedlinkerror Dlopen Failed Library Libmmkvso Not Found

My personal challenge solely helps armeabi

READ :  Can I cancel my Pacsun order?

Therefore, the reason being clearly associated to the CPU structure settings of your challenge.

Why didn’t you compile so to generate armeabi?

The ndk17 does not assist armeabi at first. The ndk model must be modified to 16 and under and the gradle plug-in must be downgraded to 4.1.3 and under. However, the gradle within the challenge has been upgraded to 7. x


Solution:

Method 1: The app’s construct.gradle checks for ndk abiFilters below android-buildTypes

ndk {
    abiFilters "armeabi"
}

Modify to

ndk {
          abiFilters "armeabi-v7a"

}

Armeabi-v7a is backward appropriate with armeabi

Method 2: If the challenge has solely armeabi structure and can’t improve to v7a, yow will discover the armeabi-v7a so by the aar package deal that mmkv maven depends upon, put the so into the challenge armeabi listing, and the abiFilters can nonetheless be “armeabi”.

Leave a Reply

Your email address will not be published. Required fields are marked *