So all the reading I've done online says to set ndk.dir
in the ANT build properties file to fix the "NDK not configured" error I'm getting from Gradle, but obviously I can't do that because I'm not using ant, I'm using Gradle+CMake.
Below is my gradle script. I'm still very new to this, I'm just trying to figure things out as I go. I got the java piece building fine in Gradle but at this point I am not able to integrate CMake.
apply plugin: 'com.android.library'
android {
compileSdkVersion 17
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 17
ndk {
moduleName "UI"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
externalNativeBuild {
cmake {
path '../../CMakeLists.txt'
}
}
}
Where can I specify the NDK path? I have an environment variable defined named ANDROID_NDK
. CMake 3.7 uses this to hunt down the location of the NDK already. Why isn't the android gradle script using it? What is the proper way since I'm not using ant?
Note: I'm trying to get things building on the command line first outside of Android Studio via gradle build
command. The error I get:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Core:UI'.
> NDK not configured.
Download it with SDK manager.)
local.properties
is an Ant-specific build file? Because now it seems like it isn't, and instead a general settings file for AS in general. Also how can I set this up in version control using environment variables? Does each person have to set this up manually? – Concord