Configure the Android NDK development environment in Windows

Source: Internet
Author: User

The specific configuration process will not be redundant. A large number of searches are made online. Mainly:
 
1) download Android NDK;
 
2) install Cygwin;
 
3) configure the environment variable of Android NDK in Cygwin. To put it bluntly, it is to map the NDK path in windows to the Cygwin environment, so that the corresponding directory can be found during later compilation;
 
4) set the properties of the Android project in Eclipse. By setting the working environment and commands, call Cygwin's compilation tool to generate a dynamic Connection Library.
Www.2cto.com
Cygwin is installed to generate a dynamic connection library for Local Code together with the NDK tool. Specific invocation commands can be set in the project attribute of eclipse.
 
After the configuration is complete, I flipped through an error. Although so can be built normally, the prompt "java. lang. usatisfiedLinkError ", has not found the cause of the problem, and then suddenly thought that the jni code is copied from the NDK sample, and the Class that calls the Native code is defined by itself, which is different from the Class in the sample. Is it because the package name of the Java Class is inconsistent with the class name? Open the JNI code and check that the Natave method has a naming rule: javascom_example_hellojni should be the Java package that calls Native code, and HelloJni should be the Java class that calls Native code. The package where your Java Class is located is the same as that in the sample. The difference is only the Class name, so you can rename your Class, OK, and run smoothly!

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.