title: Gradle: 'buildTypes' cannot be applied to groovy.lang.Closure
body: <p>After changing <code>targetSdkVersion</code> and <code>compileSdkVersion</code> to 22, and changing my <code>buildToolsVersion</code> to 22.0.1, I keep getting the following error:</p>
  
  <blockquote>
    <p>'buildTypes' cannot be applied to '(groovy.lang.Closure&lt;
    com.android.build.gradle.internal.dsl.BuildType>)'</p>
  </blockquote>
  
  <p>I looked at my <code>build.gradle</code> file and tried to look for anything that could be an error:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "22.0.1"
  
      defaultConfig {
          applicationId "********"
          minSdkVersion 14
          targetSdkVersion 22
          versionCode 17
          versionName "1.5-beta"
      }
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      productFlavors {
          freeFlavour {
              applicationId "********"
          }
          paidFlavour {
              applicationId "********"
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile 'com.google.android.gms:play-services:7.0.0'
  }
  </code></pre>