Android Studio specifies so library files that reference Jnilibs specific CPU architectures

Source: Internet
Author: User

A slightly larger project will use a third-party library, so there will inevitably be a different CPU architecture for the phone. So library files ' x86 ', ' x86_64 ', ' MIPS ', ' Mips64 ' Armeabi ', ' armeabi-v7a ', ' arm64-v8a ' But not all third-party libraries will adapt to all the CPU architecture, I have to test the use of a reduced performance and reduce the library file is only used armeabi-v7a library; armeabi-v7a The other is deleted, no armeabi-v7a, Move the Armeabi file to the armeabi-v7a and delete the rest. The following will tell you how to fit a specific CPU architecture library in the main module. Gradle plus ndk{}, the dependent module is also added

android{...    defaultconfig {    "XXXXXXX"        126    "1.2.6    "       ndk {        // Select the. So library for the corresponding CPU type to be added.    // you can also add ' x86 ', ' x86_64 ', ' MIPS ', ' Mips64  '        // ' armeabi-v7a ',  ' arm64-v8a '        modulename ' app '    }        
Abifilters is the way to filter. So files, such as the above configuration will allow your project to package only Armeabi library files, other dependent module is also configured, the end result is that your app is only suitable for Armeabi CPU models; packaged APK file libs only Armeabi's so file;

Android Studio Specifies so library files that reference Jnilibs specific CPU architectures

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.