title: Unable to load class 'com.android.build.gradle.managed.BuildType_Impl
body: <p>I am trying to do basic ndk implementation using android studio. Now i am  failed to sync gradle i think that some configurations are missed from  buid.gradle</p>
  
  <p><strong>I getting this error</strong> </p>
  
  <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>
  
  <p><strong>My buid.gradle (app)</strong> </p>
  
  <pre><code> apply plugin: 'com.android.model.application'
      model
              {
                  android {
                      compileSdkVersion = 23
                      buildToolsVersion = "23.0.1"
  
                      defaultConfig.with {
                          applicationId = "com.example.app"
                          minSdkVersion.apiLevel = 9
                          targetSdkVersion.apiLevel = 23
                          versionCode = 1
                          versionName = "1.0"
                      }
  
                  }
                  android.buildTypes {
                      release {
                          minifyEnabled = false
                          proguardFiles += file('proguard-rules.txt')
                      }
                  }
  
                      packagingOptions {
                          exclude 'META-INF/DEPENDENCIES'
                          exclude 'META-INF/NOTICE'
                          exclude 'META-INF/LICENSE'
                          exclude 'META-INF/LICENSE.txt'
                          exclude 'META-INF/NOTICE.txt'
  
                      }
  
                  android.ndk {
                      moduleName = "jniSample"
                  }
  
                  android.productFlavors {
                      // for detailed abiFilter descriptions, refer to "Supported ABIs" @
                      // https://developer.android.com/ndk/guides/abis.html#sa
                      create("arm") {
                          ndk.abiFilters.add("armeabi")
                      }
                      create("arm7") {
                          ndk.abiFilters.add("armeabi-v7a")
                      }
                      create("arm8") {
                          ndk.abiFilters.add("arm64-v8a")
                      }
                      create("x86") {
                          ndk.abiFilters.add("x86")
                      }
                      create("x86-64") {
                          ndk.abiFilters.add("x86_64")
                      }
                      create("mips") {
                          ndk.abiFilters.add("mips")
                      }
                      create("mips-64") {
                          ndk.abiFilters.add("mips64")
                      }
                      // To include all cpu architectures, leaves abiFilters empty
                      create("all")
                  }
  
                  dependencies {
                      compile fileTree(dir: 'libs', include: ['*.jar'])
                      testCompile 'junit:junit:4.12'
                      compile 'com.android.support:appcompat-v7:23.0.1'
                      compile 'com.google.android.gms:play-services-ads:8.4.0'
  
                      compile files('libs/httpclient-4.1.3.jar')
                      compile files('libs/httpcore-4.1.4.jar')
                  }
  
              }
  </code></pre>
  
  <p><strong>My build.gradle (project)</strong> </p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle-experimental:0.4.0'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p><strong>gradle.wrapper.properties</strong></p>
  
  <pre><code>distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
  </code></pre>