Android dynamic library loading Failure Analysis

Source: Internet
Author: User

Recently, I am working on multimedia development on Android. I use the JNI interface to call various underlying libraries, such as lib ***. So.
 
As shown below, 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, and install arm-None-Linux-gnueabi-GCC on Ubuntu 10.04.

Method reference:

Http://blog.csdn.net/satiling/article/details/6914466

Find the arm-None-Linux-gnueabi-LD execution program and add it to the system environment variable:

1. Vim/root/. 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. if you write a function, 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 by surfing the Internet.

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.