UnsatisfiedLinkError: dlopen failed: library “xxxx.so” not found Two possible reasons

1. The .so file is missing

Generally speaking, this problem is caused by the lack of .so files, and there are all solutions for missing .so files on the Internet, so I will not repeat them here.

2. .so file conflict

But there is another special situation, which is caused by a conflict with an existing .so file.
For example, in the situation I encountered, I copied all the .so files in the original project, and the original project was running normally, but my project always reported an error:

insert image description here
It was found in the error message that it was caused by emvjni.so. Compared with the original project, it is found that the original project does not have emvjni.so.

So I deleted emvjni.so in this project, and the code can run normally on the current device.
insert image description here

【Analyze the reasons】

Device A needs emvjni.so to run, but device B does not need emvjni.so, and emvjni.so running on device B will cause conflicts.

【solution】

Split the code into two branches dev_a and dev_b according to device A and device B,
dev_a contains emvjni.so, dev_b does not contain emvjni.so

The tutorials on the Internet are all solutions to the first case. For the second case, no information can be found at all. I encountered this problem today, so I will record it.

Guess you like

Origin blog.csdn.net/weixin_41733225/article/details/131229388