Luiz Henrique Ugliano Luiz Henrique Ugliano - 6 months ago 437
Android Question

Android Studio 2.0 - Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

I updated the Android Studio version 2.0 and was using normally. When I created a new project today, it is displaying the error Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

I realized that this problem occurs only when I create a new project. In previous projects developed, the problem does not occur and I realized that gradle is different

classpath 'com.android.tools.build:gradle:1.3.0'
.

I have to update with the same set of old projects?

My app/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "luizugliano.com.br.teste"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}


My build.gradle (Project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'

// 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
}

Answer

As of April 22nd, 2016 the latest beta version became

classpath 'com.android.tools.build:gradle:2.1.0-rc1'

And on June 3rd a stable 2.1.2 version was released which gives you the option to use

classpath 'com.android.tools.build:gradle:2.1.2' 

Updating requires you to use the gradle wrapper for 2.10 if you were still on 2.8

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

On android studio you can find your wrapper by changing to the project view and looking in gradle/wrapper/gradle-wrapper.properties

When the version is updated again you can keep up to date with the information from the release notes at http://tools.android.com/download/studio/beta