title: Cant Gradle Sync after clicking update Gradle in Android Studio - Error:Gradle 2.14.1 requires Android Gradle plugin 2.1.3 (or newer)
body: <p>This is the exact error I am getting when trying to <code>Gradle Sync</code> in <code>Android Studio</code>. All I did was click the update button when the newer version of Gradle dialog came up.</p>
  
  <p><code>
  Error:Gradle 2.14.1 requires Android Gradle plugin 2.1.3 (or newer) but project is using version 2.1.0.
  &lt;a href="fixGradleElements"&gt;Upgrade plugin to version 2.3.0 and sync project&lt;/a&gt;&lt;br&gt;&lt;a href="https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle"&gt;Open Documentation&lt;/a&gt;
  </code></p>
  
  <p>This is on my master branch which I know builds/syncs with other people.</p>
  
  <p><strong>Project Build file</strong></p>
  
  <pre><code>// This is used to improve build server performance by disable pre-dexing when building.
  // To enable this feature, use "./gradlew clean assemble -PdisablePreDex"
  // Refer: http://tools.android.com/tech-docs/new-build-system/tips
  project.ext.preDexLibs = !project.hasProperty('disablePreDex')
  subprojects {
      project.plugins.whenPluginAdded { plugin -&gt;
          if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
              project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
          } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
              project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
          }
      }
  }
  
  // This is used to control Android properties of all modules from the main project.
  // Refer: http://tools.android.com/tech-docs/new-build-system/tips
  ext {
      compileSdkVersion = 24
      buildToolsVersion = '24'
      gradleBuildToolClassPath = 'com.android.tools.build:gradle:2.2.2'
  }
  
  buildscript {
      repositories {
          mavenCentral()
          jcenter()
      }
      dependencies {
          classpath "io.realm:realm-gradle-plugin:1.2.0"
          classpath "com.google.gms:google-services:3.0.0"
      }
  }
  </code></pre>
  
  <p><strong>Application Build file</strong></p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
          maven { url 'https://maven.fabric.io/public' }
      }
      dependencies {
          classpath rootProject.ext.gradleBuildToolClassPath
          classpath 'io.fabric.tools:gradle:1.+'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  apply plugin: 'realm-android'
  
  repositories {
      jcenter()
      maven { url 'https://maven.fabric.io/public' }
      flatDir {
          dirs 'libs'
      }
  }
  
  dependencies {
      // Projects
      releaseCompile project(path: ':LibProjects:Android-Library', configuration: 'release')
      debugCompile project(path: ':LibProjects:Android-Library', configuration: 'debug')
      compile project(':LibProjects:photoview')
      compile project(':LibProjects:viewpagerindicator')
  
      // Maven libraries
      compile 'com.google.firebase:firebase-messaging:10.0.1'
      compile 'com.android.support:support-v4:24.0.0'
      compile 'com.android.support:gridlayout-v7:24.0.0'
      compile 'com.android.support:design:24.0.0'
      compile 'com.android.support:preference-v7:24.0.0'
      compile 'com.android.support:recyclerview-v7:24.0.0'
      compile 'com.android.support:multidex:1.0.1'
      compile 'com.google.android.gms:play-services-gcm:10.0.1'
      compile 'com.google.android.gms:play-services-ads:10.0.1'
      compile 'com.google.android.gms:play-services-location:10.0.1'
      compile 'com.edmodo:rangebar:1.0.0'
      compile 'com.edmodo:cropper:1.0.1'
      compile 'com.nineoldandroids:library:2.4.0'
      compile 'com.squareup.okhttp:okhttp-urlconnection:+'
      compile 'com.tonicartos:stickygridheaders:1.0.1'
      compile 'com.intellij:annotations:+@jar'
      compile 'com.mixpanel.android:mixpanel-android:4.5.3'
      compile 'com.splitwise:tokenautocomplete:2.0.7@aar'
      compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') { transitive = true; }
      compile 'com.github.clans:fab:1.6.4'
      compile ('com.facebook.android:audience-network-sdk:4.6.0') { exclude group: 'com.google.android.gms' }
      compile('com.mopub:mopub-sdk-base:4.11.0@aar')
      compile('com.mopub:mopub-sdk-native-static:4.11.0@aar')
  
      // File libraries
      compile fileTree(dir: 'libs', include: '*.jar')
      compile(name:'adsnative-sdk-2.5.3', ext:'aar')
  
      // Testing
      androidTestCompile 'com.android.support:support-annotations:24.0.0'
      androidTestCompile 'com.android.support.test:runner:0.5'
  }
  
  android {
      compileSdkVersion rootProject.ext.compileSdkVersion
      buildToolsVersion rootProject.ext.buildToolsVersion
  
      defaultConfig {
          applicationId "com.fusionprojects.edmodo"
          minSdkVersion 15
          targetSdkVersion rootProject.ext.compileSdkVersion
          versionCode 50111
          versionName "6.5.2"
          proguardFile getDefaultProguardFile('proguard-android.txt')
          vectorDrawables.useSupportLibrary = true
          multiDexEnabled true
          testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
      }
  
      packagingOptions {
          // These statements are required for solving a very annoying gradle build error:
          // "Duplicate files copied in APK META-INF/DEPENDENCIES"
          // Refer: http://blog.csdn.net/zhouzme/article/details/18923293
          exclude 'META-INF/DEPENDENCIES'
          exclude 'META-INF/NOTICE'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/DEPENDENCIES.txt'
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/NOTICE.txt'
      }
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          // Move the build types to build-types/&lt;type&gt;
          // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
          // This moves them out of them default location under src/&lt;type&gt;/... which would
          // conflict with src/ being used by the main source set.
          // Adding new build types or product flavors should be accompanied
          // by a similar customization.
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
  
          // Testing
          androidTest.setRoot('androidTest')
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFile file('proguard-project.txt')
              signingConfig signingConfigs.releaseConfig
          }
      }
  
      dexOptions {
          javaMaxHeapSize "4g"
          jumboMode true
      }
  
      lintOptions {
          abortOnError false
      }
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p><strong>Gradle wrapper</strong></p>
  
  <pre><code>#Tue Sep 06 16:30:01 PDT 2016
  distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
  </code></pre>