title: How to configure NDK with Android Gradle plugin 0.7
body: <p>The new Android gradle plugin (0.7) seems to include new support for the NDK, but in the documentation there is little to no mention of it (the only reference I found  is a test called  <a href="https://android.googlesource.com/platform/tools/build/+/2e1f7810edd76d92cee8d3e06bc4dec0c288adea/tests/ndkSanAngeles/build.gradle"><code>ndkSanAngeles</code></a>).</p>
  
  <p>It looks like gradle is looking for the NDK, which I have included in my PATH. However, building the project fails with </p>
  
  <blockquote>
    <ul>
    <li>What went wrong:
    Execution failed for task ':OGLTests:compileDefaultFlavorDebugNdk'.
    NDK not configured</li>
    </ul>
  </blockquote>
  
  <p>How can I configure the NDK in gradle?</p>
  
  <p>My current build.gradle looks like this:</p>
  
  <pre><code>task nativeLibsToJar(type: Zip, description: 'create a jar with native libs') {
      destinationDir file("$buildDir/native-libs")
      baseName 'native-libs'
      extension 'jar'
      from fileTree(dir: 'src/main/libs', include: '**/*.so')
      from fileTree(dir: 'src/main/libs', include: '**/gdb*')
      into 'lib/'
  }
  
  tasks.withType(JavaCompile) {
      compileTask -&gt; compileTask.dependsOn nativeLibsToJar
  }
  
  dependencies {
      compile fileTree(dir: "$buildDir/native-libs", include: '*.jar')
  }
  
  android {
      compileSdkVersion 19
      buildToolsVersion '19.0.0'
  
      defaultConfig {
          minSdkVersion 14
          targetSdkVersion 19
          versionCode 1
          versionName "0.1"
  
      }
      buildTypes {
          release {
              runProguard false
          }
          debug {
             // jniDebugBuild true
              runProguard false
              debuggable true
          }
      }
      productFlavors {
          defaultFlavor {
              proguardFile 'proguard-rules.txt'
          }
      }
  }
  </code></pre>
  
  <p>Thanks.</p>