Studio encountered a problem: java.lang.unsatisfiedlinkerror solution

JNI problems encountered in studio

Recently, I was doing supervideo to parse the Youku video address, which was encrypted. I need to use the corresponding key to parse and obtain the corresponding data. When quoting JNI, I found problems one after another. In the past, when I used eclipse, I directly put the so file under LIBS / armeabi /. If there are platform differences, I can add LIBS / armeabi-v7a at most. In studio, Although JNI has written about relevant projects before, it has not encountered relevant problems. It seems that it should be said that there is no problem, and it may be the biggest problem in the future. Then sum up the successive anomalies in the past two days.

First, after splicing the URL, encrypt the key and URL and call the JNI method. The first error is reported as follows:

After reading it, it means that the so file is not typed into APK, so I began to create a jnilibs under the main directory and copy so into it. (PS: it used to be referenced) so should be copied in. Once it runs, it hangs up again. The exceptions are as follows:

It's a bit unreasonable to say that there is no relevant method for the so file. After tossing for a while, it's still this error. It's unreasonable. It's not a technical difficulty. There's no reason to... There must be something wrong with what's written there. Then review the code. I found that when I invoked the native method, I didn't follow the rules. I recall that a long time ago, when I called Aidl, there was a similar situation, that is, the way of link could not be found. I looked at the package name and file name of the native method,.... I changed it to my package, but the so file declaration doesn't start with my name. Well, I see. Change to the corresponding package name and file name to solve the problem. When it's not a technical difficulty, especially review your own code. Because there's no reason to waste a lot of time.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>