Compile the JNI error log:
D:\TVMao\WorkSpace\DramaApp\TestJni>ndk-build
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersi
on 14 in ./AndroidManifest.xml
[armeabi] Compile++ thumb: test <= test.cpp
jni/test.cpp: In function ‘void Java_com_example_testjni_Decoder_sendIr(JNIEnv*,
jclass, jint, jintArray)’:
jni/test.cpp:27:20: error: base operand of ‘->’ has non-pointer type ‘JNIEnv {ak
a _JNIEnv}’
jni/test.cpp:28:28: error: base operand of ‘->’ has non-pointer type ‘JNIEnv {ak
a _JNIEnv}’
jni/test.cpp:47:8: error: base operand of ‘->’ has non-pointer type ‘JNIEnv {aka
_JNIEnv}’
make.exe: *** [obj/local/armeabi/objs/test/test.o] Error 1
The reason is
Your code uses the C style to access Env and your file is cpp
test.cpp
jsize len = (*env)->GetArrayLength(env, pattern);
(*env)->ReleaseIntArrayElements(env, pattern, patternArray, JNI_ABORT);
Solution
1. Change to test.c
2. Change to
int* patternArray = env->GetIntArrayElements(pattern, NULL);
env->ReleaseIntArrayElements(pattern, patternArray, JNI_ABORT);
Similar Posts:
- [Solved] Android jni-dlerror Error: undefined symbol: JNI_OnLoad
- About the compilation error “dereferencing pointer to incomplete type
- Pyhton Regularity Error: sre_constants.error: nothing to repeat at position
- R6010 -abort() has been called error analysis and solutions
- Steps of MyEclipse / eclipse importing sun.misc.base64encoder jar package
- Python bug problems and solutions sorted out in recent days
- Permissions required by Vibrator.vibrate: android.permission.VIBRATE
- [Solved] Eclipse Error: Access restriction: The type ‘BASE64Decoder’ is not API
- The solution of base64decoder prompt error under eclipse
- [Solved] Changing the selected file Error when uploading excel file. Net:: err_UPLOAD_FILE_CHANGED