title: Gradle task unable to find local.properties file
body: <p>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.</p>
  
  <p>My problem is that a specific task seems not to find the property-defined ndk.dir, which is defined in a local.properties file.</p>
  
  <p>The project structure is (simplified):</p>
  
  <pre><code>_ &lt;project_root&gt;
  |_ &lt;sub_project folder&gt;
      ...
      |_ main
      |_ build.gradle
      |_ local.properties
  |_ ...
  </code></pre>
  
  <p>The local.properties file looks like:</p>
  
  <pre><code>ndk.dir=/home/ubuntu/dev/android-ndk-r9c
  </code></pre>
  
  <p>And the problematic part of the task, defined in the build.gradle file of the structure, is below:</p>
  
  <pre><code>task buildNDKFlavorGooglePlayStore(type: Exec) {
      if (project.ext.has('ndk.dir') &amp;&amp; (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')
      }
  (...)
  }
  </code></pre>
  
  <p>When syncing the project, an error appears due to the gradle exception defined.</p>
  
  <p>Can anyone help? Could you tell me if it's possible to debug it?</p>
  
  <p>Thank you in advance. Don't hesitate to ask for extra information if necessary.</p>