Android NDK Development Compile-time prompt Native method not FOUND,NDK * * * could not be resolved

Source: Internet
Author: User

Type ' * * * * * ' could not being resolved

Method ' ****** ' could not being resolved et cetera a lot of that sort of mistake

Workaround:

This is due to the fact that the jni.h is not imported, and this file is under the NDK directory.

So, refer to the following steps:

Project Properties, C + + general, Path and Symbols Select the include tag, ADD, $Android _ndk_home/platforms/android-* */arch-arm/usr/include and select all languages. Finally, apply---OK, this error is resolved.

If you add a header file or a problem, it might be because the project is a C + + project, but the code is in a code that uses the

1, if not the. cpp file, see the NDK layer function name is correct, generally Java_ package name _ main Activity name _ function name

If the package name is: COM.TEST.ABC, the main activity is: Mainactivity declares the local function name: Mytest

The function name of the NDK layer should be java_com_test_abc_mainactivity_mytest.


2. If it is a. cpp file, use the extern "C" {"Method Here"}, the local method in curly braces, to learn the Javah generated header file.

#ifdef __cplusplus
extern "C" {
#endif
Jniexport Jbytearray Jnicall Java_com_example_myeclipsejni_mainactivity_mydecrypt
(jnienv *ent, Jobject obj, Jbytearray paramarrayofbyte, jstring paramstring)
{
Code
}
#ifdef __cplusplus
}
#endif

Android NDK Development Compile-time prompt Native method not FOUND,NDK * * * could not be resolved

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.