title: Gradle DSL method not found: 'compile() The project 'android' may be using a version of Gradle that does not contain the method
body: <p>I am stucked at this problem since 2-3 hours. I tried many solution from similar question but none is working. The gradle build was working fine but after changing min sdk level from 23 to 17 android studio started giving me this error.</p>
  
  <p>Error:(32, 0) Gradle DSL method not found: 'compile()'Possible causes:</p>
  
  <p>The project 'android' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
  Upgrade plugin to version 2.3.3 and sync project</p>
  
  <p>The project 'android' may be using a version of Gradle that does not contain the method.
  Open Gradle wrapper file</p>
  
  <p>The build file may be missing a Gradle plugin.
  Apply Gradle plugin</p>
  
  <p>Below are my gradle files:</p>
  
  <p>build.gradle(project:android)</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          mavenLocal()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.3.3'
          classpath 'com.google.gms:google-services:3.0.0'
  
      }
  }
  
  allprojects {
      repositories {
          mavenLocal()
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>build.gradle (module:app)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion '25.0.0'
      defaultConfig {
          applicationId "com.google.transporttracker"
          minSdkVersion 17
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          resValue "string", "build_transport_id", (project.findProperty("build_transport_id") ?: "")
          resValue "string", "build_email", (project.findProperty("build_email") ?: "")
          resValue "string", "build_password", (project.findProperty("build_password") ?: "")
      }
      packagingOptions {
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/LICENSE-FIREBASE.txt'
          exclude 'META-INF/NOTICE'
      }
      productFlavors {
      }
  }
  
  ext {
      support = '23.2.0'
      playServices = '10.2.4'
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile "com.android.support:appcompat-v7:$support" compile "com.android.support:cardview-v7:$support" compile "com.android.support:design:$support" compile "com.google.android.gms:play-services-gcm:$playServices" compile "com.google.android.gms:play-services-location:$playServices" compile "com.google.firebase:firebase-core:$playServices" compile "com.google.firebase:firebase-auth:$playServices" compile "com.google.firebase:firebase-config:$playServices" compile "com.google.firebase:firebase-crash:$playServices" compile "com.google.firebase:firebase-database:$playServices" compile 'com.android.support.constraint:constraint-layout:1.0.2'
      classpath 'com.google.gms:google-services:3.0.0'
      compile 'com.google.android.gms:play-services-maps:10.2.4'
      compile 'com.android.support:appcompat-v7:23.4.0'
      testCompile 'junit:junit:4.12'
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>