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

Android

Android Problem Overview


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
}

Android Solutions


Solution 1 - Android

> UH OH, Google Notice: "This website no longer provides downloads for Android Studio." > >(Old 'channel' links no longer work. Links in this answer have been updated to the new formats, make sure to change your bookmarks if you were using them)

You need to update the version of the gradle tools you are building with. This can be found inside the dependencies section of your build.gradle. You have 3 options you can update to:

The latest stable version referenced in the release channel as of 2nd March, 2017 is

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

Or the latest beta version via preview channel as of 15th February, 2017 is

classpath 'com.android.tools.build:gradle:2.3.0-beta4'

And the latest alpha version also from the preview channel as of 21st March, 2017 gives you the option to use

classpath 'com.android.tools.build:gradle:2.4.0-alpha3' 

Updating requires you to also upgrade the gradle wrapper. As of 20th February '17, the newest is:

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

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

Sometimes after changing wrapper the project will fail to compile with an error like “Minimum supported Gradle version is 2.14.1. Current version is 2.10. Try changing Gradle distribution version to...” despite already having the correct version in gradle-wrapper.properties. If that happens try the following:

Go to Settings > Build, Execution, Deployment > Gradle

Under Project-level settings ensure that Use default gradle wrapper (recommended) is the selected option, then re-build your project.

(Additional Note: With regards to the alpha and beta versions - there is not always a newer build than the stable version when I check, in those cases I've just given values for the previous version. This allows you to roll back to that version if you experience issues with the released version)

Solution 2 - Android

In new project change this part:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha1'

with

dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'.

If you're not experienced user, please stick with Android Studio's Updates Stable Channel. I suppose you got Android Studio from Canary Channel.

Note that: > The Canary Channel for Android Studio delivers the bleeding edge updates on a roughly weekly basis. While these builds do get tested, > they are still subject to bugs, as we want people to see what's new as > soon as possible. > > From: http://tools.android.com/download/studio/canary

You don't need to change dependencies of your older projects. They should run normally on the latest version.

Solution 3 - Android

Same problem on update. this Fixed it for me:[build.gradle]

    classpath 'com.android.tools.build:gradle:2.0.0-alpha3'

or

    classpath 'com.android.tools.build:gradle:2.0.0-beta2'

Solution 4 - Android

Just in Advanced System Settings in Windows Properties, add a new environment variable with the name ANDROID_DAILY_OVERRIDE and the given value in error message. Restart android studio and you will be ready to go

enter image description here

Solution 5 - Android

As of April 5, 2016 this worked for me:

classpath 'com.android.tools.build:gradle:2.0.0-rc3'

Solution 6 - Android

gradle version you need became

classpath 'com.android.tools.build:gradle:2.0.0-beta7'

Which requires you to use the gradle wrapper for 2.10 if you were still using previous version

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

Solution 7 - Android

classpath: com.android.tools.build:gradle:+

This will solve the problem by updating gradle to latest one.

However it is dangerous(will code in alpha stage) & will also give warnings.

Solution 8 - Android

If you are using Android Studio 2.0 Preview I can suggest using 'beta' updates channel instead of 'stable'. It will allow you to receive latest gradle configuration changes. You can change updates channel in Settings - Appearance & Behavior - System Settings - Updates. Select Automatically check updates for [Beta Channel]

In order to know actual version of gradle classpath and distributionUrl (check Nick Caroso's answer) you can create new empty project and see these values there.

Solution 9 - Android

You need to change your gradle-wrapper.properties file in gradle/wrapper folder of your app, change your distributionUrl as this:

distributionUrl=http\://services.gradle.org/distributions/gradle-2.8-all.zip

Use http: or https:\ as per your requirement. Then just clean your project and you are done!!!

Side Note :

classpath 'com.android.tools.build:gradle:2.0.0-alpha3'

is available now, if you want to use latest version.

Also you can take advantage of instant run feature of android studio using this, which is not available in gradle version below 2.0.0

Solution 10 - Android

Android Studio 2.0 has an update project to use instant-run. For those like me with little brains:

http://tools.android.com/tech-docs/instant-run

The current version of Android Studio 2.0 is Beta 6.

Solution 11 - Android

try update gradle to 2.10

for mac, tha path is Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle

of course you must download gradle 2.10 before

Solution 12 - Android

I got the same error on 04/07/2016 with 'com.android.tools.build:gradle:2.2.0-alpha2' and gradle wrapper 2.10 then, I just changed to

'com.android.tools.build:gradle:2.2.0-alpha3'

now I have no problems.

Hope this help peple.

Solution 13 - Android

I have resolved this way.

Steps:

  1. Open gradle-wrapper.properties file and change distributionUrl to https\://services.gradle.org/distributions/gradle-2.14.1-all.zip.
  2. Open root level build.gradle and change classpath to com.android.tools.build:gradle:2.2.2.
  3. Sync your Android studio project.

Reference screen shot:

enter image description here

Done.

Solution 14 - Android

just change classpath 'com.android.tools.build:gradle:2.0.0-alpha ' or

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

Solution 15 - Android

I change my classpath from 'com.android.tools.build:gradle:2.2.0-alpha4'

to classpath 'com.android.tools.build:gradle:2.2.0-alpha5'

and clicked "try_again" when the warning appears "unable to find cached classpath" you just click "sync", this worked like a breeze.

Solution 16 - Android

This problem occures generally when the IDE(android studio) in which project is build and the project are not in compatible gradle plug in. Please check the link below http://tools.android.com/tech-docs/new-build-system/version-compatibility

In my case i had created a project using AS 1.0/2.0 version, and later imported in studio version new it gave me error then I opened project in older version of AS it worked. you can also check http://tools.android.com/tech-docs/new-build-system

Solution 17 - Android

File -> Project Structure -> Project -> Android Plugin version = 2.2.3

Working fine of Android Studio 2.2.3

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLuiz Henrique UglianoView Question on Stackoverflow
Solution 1 - AndroidNick CardosoView Answer on Stackoverflow
Solution 2 - Androidpiotrek1543View Answer on Stackoverflow
Solution 3 - AndroidSonniEView Answer on Stackoverflow
Solution 4 - AndroidfatihView Answer on Stackoverflow
Solution 5 - Androidj2abroView Answer on Stackoverflow
Solution 6 - AndroidPhani varmaView Answer on Stackoverflow
Solution 7 - AndroidSanyam JainView Answer on Stackoverflow
Solution 8 - AndroidArtem MView Answer on Stackoverflow
Solution 9 - Androidvivek vekariyaView Answer on Stackoverflow
Solution 10 - AndroidfishjdView Answer on Stackoverflow
Solution 11 - AndroidyfsxView Answer on Stackoverflow
Solution 12 - AndroidVrian7View Answer on Stackoverflow
Solution 13 - AndroidHiren PatelView Answer on Stackoverflow
Solution 14 - AndroidAbolfazl MiadianView Answer on Stackoverflow
Solution 15 - AndroidjoeView Answer on Stackoverflow
Solution 16 - Androidmaruti060385View Answer on Stackoverflow
Solution 17 - AndroidAndroid DevView Answer on Stackoverflow