Questions: use as the signature package, in the debugging has been used 5.0 of the Xiaomi phone can be normal operation, 4.4 of the Lenovo phone Flash back, 5.1 of the simulator on the flash back.
Thrown: Java.lang.unsatisfiedlinkerror,classloader cannot find the relevant so library.
Solution Ideas:
The conjecture is related to the CPU architecture, and the query is as follows (Cat/proc/cpuinfo):
Simulator: The computer is using Intel's CPU x86_64 architecture
Lenovo: Processor:armv7 Processor Rev 2 (v7l) armeabi-v7a
Xiaomi: Processor:aarch64 Processor Rev 2 (aarch64) arm64-v8a
Question one, what CPU architectures does Android support?
The answer is easy to search: Android currently supports 7 architectures
x86_64
x86
Mips64
Mips
armeabi-v7a
Armeabi
arm64-v8a
Question two, how does the system find so library?
Find so Library rules:
when running, the system will find the so library in the Jnidirs directory, and the corresponding directory will be found based on the current platform schema. There is a rule in this which is the culprit of the problem. when you provide only the Armeabi directory, armeabi-v7a, ARM64-V8A architecture program will go to Armeabi, and when you also provide armeabi-v7a, armeabi-v8a directory, And there is no corresponding so library, the system will not go to Armeabi inside the search, directly can not find an error.
There are seven of these directories in the signature package, which is discussed later in this question.
Validation conjecture:
app-release.apk use packaging software to open, delete the armeabi-v7a directory, found that the Lenovo phone can run normally (to Armeabi inside looking for). Remove the x86_64 folder, the emulator can run normally (go to x86 inside to look for).
Question three, the signature package why all seven directories have?
Corresponds to seven directories in the Jnidirs directory. Open the signature package and discover that all seven directories have one. It is strange that my project is only x86, Armeabi and arm64-v8a three types of so libraries. Open Other directory discovery is only one so file: libgenius_graphics.so. Think of the solution to this from where, find Build-gradle when found: Compile ' net.qiujuer.genius:graphics:2.0.0-beta8 ' very similar, this is an open source UI library. The guess is to introduce this library to automatically generate libgenius_graphics.so files under each platform at compile time. Remove it, rebuild, this is true, leaving only the original three folders.
Question four, Armeabi can be compatible with x86 platform?
And when I even removed the x86 folder, it could not be installed on the emulator at all, prompting: Install_failed_no_matching_abis. Prove that the x86 architecture does not look for the Armeabi directory. When you want to run the app on a x86 machine, be sure to get the corresponding x86 version so library file.
This article is from a "sword Siege" blog, please make sure to keep this source http://weijiancheng.blog.51cto.com/10190955/1891876
An Android multi-platform problem compatible solution idea