用cmake建立gradle

时间:2018-01-07 08:39:58

标签: android cmake

我收到错误“无法让CMake版本位于C:\ Users \ Mujtaba Faizi \ Downloads \ cmake-3.10.1 \ bin”但我在build.gradle中给出了版本3.10.1 local.properties中的路径。我已经这么久了。提前谢谢。

的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.mujtaba.basicai"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/', 'src/main/jniLibs/armeabi-v7a'] }
    }

    externalNativeBuild {
    cmake {
        version "3.10.1"
        path 'CMakeLists.txt'
    }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile files('libs/libandroid_tensorflow_inference_java.jar')
    compile 'com.flurgle:camerakit:0.9.13'   //for camera access purposes
}

local.properties:

cmake.dir=C\:\\Users\\Mujtaba Faizi\\Downloads\\cmake-3.10.1
ndk.dir=C\:\\Users\\Mujtaba Faizi\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\Mujtaba Faizi\\AppData\\Local\\Android\\Sdk

1 个答案:

答案 0 :(得分:0)

这个帖子有点老了。但在我的情况下,我没有将 cmake 版本添加到 gradle 文件中,而是我只需要添加到 local.properties 的路径

cmake.dir=/home/rafal/Pobrane/cmake-3.11.0