编译5.1的时候遇到'register_android_system_OsConstants(_JNIEnv*)',发现是jni.h文件找不到,这个文件并不在Android源码而是在jdk里的include文件夹下。
最简单的方法将include的加到环境变量里:JAVA_HOME/include
log如下:
host SharedLib: libjavacore_32 (out/host/linux-x86/obj32/lib/libjavacore.so)
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libjavacore_intermediates/luni/src/main/native/android_system_OsConstants.o: file is emptylibcore/luni/src/main/native/Register.cpp:36: error: undefined reference to 'register_android_system_OsConstants(_JNIEnv*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [out/host/linux-x86/obj32/lib/libjavacore.so] Error 1