为什么 不能打印log 是因为要在cMakeLists中配置什么东西吗 请高手帮忙

/* DO NOT EDIT THIS FILE - it is machine generated /
#include
#include
#include
#define TAG "JNI"
#define LOGD(...) android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS)
/
Header for class com_wistrol_jnitest_MyJni */

#ifndef _Included_com_wistrol_jnitest_MyJni
#define _Included_com_wistrol_jnitest_MyJni
#ifdef __cplusplus
extern "C" {
#endif
/*

  • Class: com_wistrol_jnitest_MyJni
  • Method: changeArray
  • Signature: ([I)[I / JNIEXPORT jintArray JNICALL Java_com_wistrol_jnitest_MyJni_changeArray (JNIEnv * env, jclass jObject, jintArray jArray){ jsize length = (*env)->GetArrayLength(env,jArray); int arrayPointer = (*env)->GetIntArrayElements(env,jArray,NULL); int i; for(i=0;i<length;i++){ *(arrayPointer + i) += 5; } LOGD("length=%d", length); return jArray; }

#ifdef __cplusplus
}
#endif

你开发的NDK吧,需要在cMakeLists.txt中添加
add_library( # Sets the name of the library.
native-lib

         # Sets the library as a shared library.
         SHARED

         # Provides a relative path to your source file(s).
         src/main/cpp/native-lib.cpp )

#然后在model的gradle文件android中添加

externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}