Android中头文件路径和AttachCurrentThread声明的参数不同:
在javah 生成的头文件中添加:
#ifdef _ANDROID_MK
#include "nativehelper/jni.h"
#define AttachCurrentThread(a, b) AttachCurrentThread((JNIEnv**) a, b)
#endif
Android.mk加上
LOCAL_CPPFLAGS += D_ANDROID_MK
OK 代码又多跨越了一个平台。