title: Android NDK Integration: Error:Unable to load class BuildType$Impl
body: <p>I am trying to integrate NDK into my project. I am using Gradle wrapper 2.9 and classpath:<code>gradle-experimental:0.6.0-alpha3</code>. </p>
  
  <p>Project level gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha6'
        }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>App level gradle:</p>
  
  <pre><code>apply plugin: 'com.android.model.application'
  
  model {
      android {
          compileSdkVersion = 23
          buildToolsVersion = "23.0.2"
  
          defaultConfig.with {
              applicationId = "com.ms.knowursensor.android"
              minSdkVersion.apiLevel = 11
              targetSdkVersion.apiLevel = 23
          }
      }
  
      compileOptions.with {
          sourceCompatibility=JavaVersion.VERSION_1_7
          targetCompatibility=JavaVersion.VERSION_1_7
      }
  
      android.ndk {
          moduleName = "sensorgraph"
      }
      android.buildTypes {
          release {
              minifyEnabled = false
              proguardFiles  += file('proguard-rules.txt')
          }
      }
      android.productFlavors {
          create("arm") {
              ndk.abiFilters += "armeabi"
          }
          create("arm7") {
              ndk.abiFilters += "armeabi-v7a"
          }
          create("arm8") {
              ndk.abiFilters += "arm64-v8a"
          }
          create("x86") {
              ndk.abiFilters += "x86"
          }
          create("x86-64") {
              ndk.abiFilters += "x86_64"
          }
          create("mips") {
              ndk.abiFilters += "mips"
          }
          create("mips-64") {
              ndk.abiFilters += "mips64"
          }
          create("all")
      }
  
       dependencies {
          compile fileTree(dir: 'libs', include: ['*.jar'])
          compile 'com.android.support:appcompat-v7:23.1.1'
          compile 'com.android.support:support-v4:23.1.1'
          compile 'com.android.support:design:23.1.1'
          compile 'com.android.support:cardview-v7:23.1.1'
          compile 'com.android.support:recyclerview-v7:23.1.1'
      }
  }
  </code></pre>
  
  <p>On building app, i receive this error:</p>
  
  <blockquote>
    <p>Error:Unable to load class
    'com.android.build.gradle.managed.BuildType$Impl'. Possible causes for
    this unexpected error include:<ul><li>Gradle's dependency cache may be
    corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires
    network)</li><li>The state of a Gradle build process (daemon) may
    be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires
    restart)</li><li>Your project may be using a third-party plugin
    which is not compatible with the other plugins in the project or the
    version of Gradle requested by the project.</li></ul>In the case of
    corrupt Gradle processes, you can also try closing the IDE and then
    killing all Java processes.</p>
  </blockquote>
  
  <p>After modifying description of proguard and product flavor i am receiving this error:</p>
  
  <pre><code>Error:A problem occurred configuring project ':app'.
  &gt; The following model rules could not be applied due to unbound inputs and/or subjects:
      compileOptions.with { ... } @ app\build.gradle line 15, column 5
        subject:
          - compileOptions.with Object [*]
      dependencies { ... } @ app\build.gradle line 68, column 6
        subject:
          - dependencies Object [*]
    [*] - indicates that a model item could not be found for the path or type.
  </code></pre>