Android dynamic library loading Failure Analysis

Source: Internet
Author: User

Recently, I am working on multimedia development on Android. Using the JNI interface to call various underlying libraries, for example, lib ***. so is shown as follows, and loading is always unsuccessful. Debugging found that each time the so library is loaded, it will jump to the catch Exception Handling Section and print the exception log information. 1. static {2. try {3. system. load ("/data/com. * **/lib ***. so "); 4 .} 5. catch (UnsatisfiedLinkError ulink) {6. log. I ("HVnative =", "Can not load library"); 7. ulink. printStackTrace (); 8 .} 9 .} you can use the arm-none-linux-gnueabi-ld tool to analyze the dynamic library on the Internet. to install the arm-none-linux-gnueabi-gcc Method on ubuntu 10.04, refer: the http://blog.csdn.net/satiling/article/details/6914466 finds the arm-none-linux-gnueabi-ld executable and adds it to the system environment variable: 1.vim/roo T/. bashrc 2. PATH = $ PATH: absolute PATH 3. source/root/. bashrc make the environment variable take effect immediately, and the analysis tool is done! If the function printed after "undefined reference to" is: 1. You should check whether the code you have written has any problems. After modification, recompile the underlying library. 2. The system function has not found a proper solution for the moment. I am trying to find a solution.

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.