尝试使用NDK构建应用,但收到错误:
D:\AndroidProjects\SampleProject\Jmaster\src\main\jni\expat-2.0.1\amiga\expat_lib.c:24:21: fatal error: dos/dos.h: No such file or directory
make.exe: *** [D:\AndroidProjects\SampleProject\Jmaster\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/DeflatingDecompressor-v3/D_\AndroidProjects\SampleProject\Jmaster\src\main\jni\expat-2.0.1\amiga\expat_lib.o] Error 1
#include <dos/dos.h>
compilation terminated.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\android-ndk-r10d\ndk-build.cmd'' finished with non-zero exit value 2
如何解决这个问题?
答案 0 :(得分:0)
android {
sourceSets.main {
jni.srcDirs = []
}
}
在fbreadj
模块的build.grade
ndk-build
模块的根目录中使用fbreadj
。然后,将生成.so文件..
有一些链接可能会帮助你:
http://ph0b.com/android-studio-gradle-and-ndk-integration/ http://web.guohuiwang.com/technical-notes/androidndk1
(原谅&忘记我可怜的英语.. :)