It seems that the. So file cannot be directly added to the android jar package.

Source: Internet
Author: User

If you directly place a XXX. So file in/libs/armeabi in a jar file and export it as a jar package, such as A. jar,

In an androidProgramTo reference this A. jar file, the following error occurs during compilation:

The library 'a. jar' contains native libraries that will not run on the device. The following libraries were found:-libs/armeabi/libxxx. So

I searched the internet and found no solution.

You can only use the following method:

1. For example, iflytek (/MSC/assets/lib/MSC. Jet: the first four bytes of the file are. Elf, and the class is a JNI function at the end of the file.

Directly change the. So file to an extension, put it in assert, export it to jar, and copy it

Manually load the so library file under the directory of the calling program

2. Put the. So file in jar directly under/libs/armeabi of the target program.

(The. So file mentioned above is for the ARM architecture. If it is x86, change the corresponding directory above to the/libs/x86/directory)

 

In short, when Android Package A project into a jar package, it is best to include onlySource codeIn addition, it can contain some files, such as assert or the number of custom files,

However, do not protect resource files (the content of all files under/RES should not be placed in the jar package ).

Related Article

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.