错误:Android NDK构建错误

时间:2016-09-20 19:13:42

标签: android android-ndk

我已经面对很多天了。我尝试了所有的事情,但我不明白我哪里出错了。这个错误不断出现。

Android NDK: WARNING: APP_PLATFORM android-24 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml    
make: Entering directory `D:/Android/androidProjects/face-detection/openCVSamplefacedetection/src/main'
jni/Android.mk:8: ../../sdk/native/jni/OpenCV.mk: No such file or directory
make: Leaving directory `D:/Android/androidProjects/face-detection/openCVSamplefacedetection/src/main'
make: *** No rule to make target `../../sdk/native/jni/OpenCV.mk'.  Stop.
:openCVSamplefacedetection:ndkBuild FAILED
Error:Execution failed for task ':openCVSamplefacedetection:ndkBuild'.
  

处理'命令' ndk-build.cmd''完成非零退出值2   信息:BUILD FAILED

这是build.gradle

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

apply plugin: 'com.android.application'

android {
sourceSets.main {
    jniLibs.srcDir 'src/main/libs' //set .so files directory to libs
    jni.srcDirs = [] //disable automatic ndk-build call
}

// 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
}





compileSdkVersion 11
buildToolsVersion "24.0.2"

defaultConfig {
    applicationId "org.opencv.samples.facedetect"
    minSdkVersion 8
    targetSdkVersion 8

    ndk {
        moduleName "detection_based_tracker"
    }
}

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

dependencies {
compile project(':openCVLibrary249')
}

这是local.properties

ndk.dir=D\:\\Android\\android-ndk-r12b
sdk.dir=D\:\\Android

0 个答案:

没有答案