dimanche 19 avril 2015

NDKBuild Failure

I'm having trouble getting my NDK to compile properly in Android Studio. Whenever I try running to compile I am getting the following error.



Error:Execution failed for task ':app:ndkBuild'. A problem occurred starting process 'command 'ndk-build.cmd''



I have the following setup


enter image description here


And my build.gradle file is the following.



import org.apache.tools.ant.taskdefs.condition.Os

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "edu.uky.cs.www.diagramaphone"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"

sourceSets.main{
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
project.ext.versionCodes = ['armeabi':1, 'armeabi-v7a':2, 'arm64-v8a':3, 'mips':5, 'mips64':6, 'x86':8, 'x86_64':9] //versionCode digit for each supported ABI, with 64bit>32bit and x86>armeabi-*
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
output.versionCodeOverride =
project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + defaultConfig.versionCode
}
}
// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath
} else {
commandLine 'ndk-build', '-C', file('src/main').absolutePath
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
//ndk {
// moduleName "shape-detect"
//cFlags "-DANDROID_NDK -D_DEBUG DNULL=0" // Define some macros
//ldLibs "EGL", "GLESv3", "dl", "log" // Link with these libraries!
//stl "stlport_shared" // Use shared stlport library
//}

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':libraries:tess-two')
compile project(':libraries:opencv')
}


At this point I'm lost as to what can be wrong. I've followed several tutorials to try setting up the NDK to work properly, but I keep getting the error I showed above. Can anyone here provide some feedback on what I need to do in order to get the NDK to compile?


Aucun commentaire:

Enregistrer un commentaire