First of all, I have to admit I have quite experience with android and ndk, but gradle scripts is a new topic for me. I'm working on a project whose gradle scripts are already written (it is not my part) and work fine.
My problem is that a specific task seems not to find the property-defined ndk.dir, which is defined in a local.properties file.
The project structure is (simplified):
_ <project_root>
|_ <sub_project folder>
...
|_ main
|_ build.gradle
|_ local.properties
|_ ...
The local.properties file looks like:
ndk.dir=/home/ubuntu/dev/android-ndk-r9c
And the problematic part of the task, defined in the build.gradle file of the structure, is below:
task buildNDKFlavorGooglePlayStore(type: Exec) {
if (project.ext.has('ndk.dir') && (project.ext.get('ndk.dir') != null)) {
ext.ndkBuild = new File((String)project.ext.get('ndk.dir'), 'ndk-build')
executable ndkBuild
} else {
throw new GradleException('Reason: ndk.dir is missing in ' + projectDir + '/local.properties')
}
(...)
}
When syncing the project, an error appears due to the gradle exception defined.
Can anyone help? Could you tell me if it's possible to debug it?
Thank you in advance. Don't hesitate to ask for extra information if necessary.
gradle.properties
instead oflocal.properties
?