我在用APP_ABI := armeabi armeabi-v7a x86的进行编译的时候,一直编译不了,第三方的SO是个X86的,于是X86的编译能过去,但是ARM的就不行了:
root@hjm-H61M-DS2:~/workspace/JNI/jni# $NDK8/ndk-build
Compile thumb : addjni <= libaddjni22.c
SharedLibrary : libaddjni.so
/root/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: skipping incompatible /root/workspace/JNI/jni/libaddjni/libfoo_x86.so when searching for -lfoo_x86
/root/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lfoo_x86
collect2: ld returned 1 exit status
make: *** [/root/workspace/JNI/obj/local/armeabi/libaddjni.so] Error 1
如果有或创建Application.mk文件,则在该文件添加如下内容:
APP_ABI := armeabiarmeabi-v7a x86
如果没有或不想使用Application.mk文件,则在ndk-build参数中添加APP_ABI=“armeabi armeabi-v7a x86”
so文件都会打在apk中,而且会依据系统CPU架构进行安装。