任务':app:swigPs'的执行失败。 >进程'命令'swig''以非零退出值1结束

时间:2017-01-25 15:17:18

标签: android android-studio android-gradle speech-recognition cmusphinx

我想运行我的项目来测试已创建的程序,同时Gradle不是错误,但是当出现项目构建错误时:

Error:Execution failed for task ':app:swigPs'. > Process 'command 'swig'' finished with non-zero exit value 1

这是我的Gradle in app:

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}*/

task ndkBuild(type: Exec) {
    commandLine "${ndkDir}/ndk-build${ndkExt}"
}
ndkBuild.outputs.dir "libs"
ndkBuild.outputs.dir "obj"

task mkdir < {
    new File('build/generated-src/java').mkdirs()
}

task swigSb(type: Exec) {
    commandLine 'swig',
            "-I../sphinxbase/include", "-I../sphinxbase/swig",
            "-java", "-package", "edu.cmu.pocketsphinx",
            "-outdir", "build/generated-src/java", "-o", "jni/sphinxbase_wrap.c",
            "../sphinxbase/swig/sphinxbase.i"
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn swigSb
}

task swigPs(type: Exec) {
    commandLine 'swig',
            "-I../sphinxbase/swig",
            "-I../pocketsphinx/include",
            "-I../pocketsphinx/swig",
            "-java", "-package", "edu.cmu.pocketsphinx",
            "-outdir",  "build/generated-src/java",
            "-o", "jni/pocketsphinx_wrap.c",
            "../pocketsphinx/swig/pocketsphinx.i"
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn swigPs
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn mkdir
}
gradle.projectsEvaluated {
    preBuild.dependsOn mkdir
    preBuild.dependsOn swigSb
    preBuild.dependsOn swigPs
    preBuild.dependsOn ndkBuild
}

/*compileJava.dependsOn mkdir
compileJava.dependsOn swigSb
compileJava.dependsOn swigPs
compileJava.dependsOn ndkBuild*/

ndkBuild.dependsOn swigSb
ndkBuild.dependsOn swigPs

完整Gradle文件Because my code too much

Gradle Console出错 Gradle Console

请帮帮我。感谢

0 个答案:

没有答案