Findlibrary returned null generated Lenovo, Android NDK Development packaging When we should pay attention to the compatibility of the platform (X86,ARM,ARM-V7A)

Source: Internet
Author: User

Many friends in the development of the Android JNI, will encounter Findlibrary returned null error, for some reason, so is not packaged into the APK. The following is an analysis of the cause of the error and platform compatibility issues.


first, there is no reason to pack so into the APK.

When you find the findlibrary returned null error, the most straightforward solution is to unzip the APKto see the APK x86, Armeabi, If there is a corresponding so in the armeabi-v7a folder, you may find less so in the corresponding folder and then check the reason.


There are generally two reasons for this:


there is a folder for the corresponding platform in 1.apk, but there is no corresponding so in the folder.

For example, when the x86 folder appears under Lib in the APK, the program will load the x86 corresponding library when it runs, but if the x86 folder does not come in at this time, an error will be encountered.


2. Third-party compatibility policies with the platform are inconsistent with their own.

It is possible that a third party has chosen to support only Armeabi (assuming a payment SDK), but our game is configured in application.mk with app_abi: = All, and So, our game is packaged with so on all platforms, But the third party only Armeabi folder corresponding so, causing the program to run abnormally, this situation in the development of the most common, some small companies due to insufficient testing personnel or testing equipment, after the online only to find this problem is not surprising.


second, for the platform support, we should choose how. armeabi-v7a is indeed compatible with a rmeabi, and v7a CPU support hardware floating point arithmetic, the current large logarithmic device is already v7a, so in order to better performance, do not put to Armeabi for compatibility. x86 is compatible with the Armeabi platform, whether armeabi-v7a or Armeabi, but also the performance of the loss, also need to point out that the packaging of the x86 so, Will always be smaller than the Armeabi platform , for the performance of the children who are neat, or recommended in packaging so when supporting x86. Specifically, the performance loss, the author is not very clear, you can visit the official Intel in the CSDN blog. a summary of the performance in the project is:
If the project contains only Armeabi, it can be run on all Android devices; If the project contains only armeabi-v7a, it can be run in addition to the Armeabi architecture; If the project contains only x86, then the armeabi architecture and armeabi-v7a Android devices will not work; if both Armeabi, armeabi-v7a and x86 are included, all devices can be run, and the program will load different platforms corresponding to so when it is running, which is a perfect solution, and also causes the package to become larger.

Findlibrary returned null generated Lenovo, Android NDK Development packaging When we should pay attention to the compatibility of the platform (X86,ARM,ARM-V7A)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.