title: Gradle build Error:Cause: org.gradle.api.internal.ExtensibleDynamicObject
body: <p>I am trying to import '<a href="https://code.google.com/p/android-serialport-api/">https://code.google.com/p/android-serialport-api/</a>'into Android Studio. Since this project involves ndk, I followed the instructions to build NDK from the following link: <a href="http://tools.android.com/tech-docs/new-build-system/gradle-experimental">http://tools.android.com/tech-docs/new-build-system/gradle-experimental</a></p>
  
  <p>But after building, I get this error: 
  Gradle Project refresh Failed<br>
  Error:Cause: org.gradle.api.internal.ExtensibleDynamicObject </p>
  
  <p>EDIT: I have 2.5 gradle version installed
  Here's my build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.model.application'
  
  model {
  
    android {
  compileSdkVersion 22
  buildToolsVersion "22.0.1"
  
  defaultConfig.with {
      applicationId = "android_serialport_api.sample"
      minSdkVersion.apiLevel =  17
      targetSdkVersion.apiLevel = 22
  
      android.ndk {
          moduleName = "serial_port"
      }
  
      android.buildTypes {
          release {
              minifyEnabled = false
              proguardFiles  += file('proguard-rules.txt')
          }
      }
  
      android.productFlavors {
  
          create("all")
      }
  
  }
  
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
       }
     }
  
    }
  
  }
  </code></pre>