插件太老了,请更新到最新版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

时间:2022-11-25 00:23:35

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

我更新了Android Studio 2.0版本,并且正常使用。当我今天创建一个新项目时,它显示的错误插件太旧了,请更新到最新的版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

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'.

我意识到这个问题只有在我创建一个新项目时才会出现。在之前开发的项目中,问题没有发生,我意识到gradle是不同的类路径。android.tools.build:gradle:1.3.0。

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

我必须更新同一套旧项目?

My app/build.gradle

我的应用程序/ 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)

我的建立。gradle(项目)

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

17 个解决方案

#1


131  

UH OH, Google Notice: "This website no longer provides downloads for Android Studio."

哦,谷歌通知:“这个网站不再为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:

您需要更新您正在构建的gradle工具的版本。这可以在您的build.gradle的dependencies部分中找到。你有三个选项可以更新:

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

截至2017年3月2日发布频道引用的最新稳定版本为

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

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

或者是在2017年2月15日通过预览频道发布的最新测试版。

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

而最新的alpha版本也将在2017年3月21日的预览版中提供使用的选项

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:

更新要求您也要升级gradle包装。截至17,17年2月20日,最新的是:

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

在android studio中,您可以通过切换到project视图并查看gradle/wrapper/gradle .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:

有时,在更改包装器之后,项目将无法以“最小支持的Gradle版本2.14.1”这样的错误编译。当前版本是2.10。试着将等级发行版本更改为……“尽管已经有了正确的版本,在gradle-wrapper.properties。如果发生这种情况,请尝试以下方法:

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.

在项目级设置下,确保使用默认的gradle包装(推荐)是所选选项,然后重新构建项目。

(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)

(补充说明:关于alpha和beta版本——在我检查时,并不总是有比稳定版本更新的版本,在这些情况下,我刚刚为前一个版本赋值。如果您在发布版本中遇到问题,可以回滚到该版本)

#2


26  

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.

如果您没有经验,请坚持使用Android Studio的更新稳定频道。我想你是从Canary频道买的。

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.

Android Studio的Canary Channel大约每周提供最新的edge版本。虽然这些构建已经经过了测试,但是它们仍然受到bug的影响,因为我们希望人们尽快看到新的内容。

From: http://tools.android.com/download/studio/canary

来自: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.

您不需要更改旧项目的依赖关系。它们应该在最新版本中正常运行。

#3


12  

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'

#4


7  

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

仅在Windows属性中的高级系统设置中,添加一个名为ANDROID_DAILY_OVERRIDE的新环境变量,并在error message中添加给定值。重新启动android studio,就可以开始了

插件太老了,请更新到最新版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

#5


5  

As of April 5, 2016 this worked for me:

截至2016年4月5日,这对我起了作用:

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

#6


2  

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.

但是它是危险的(将在alpha阶段编码)&也会给出警告。

#7


2  

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]

如果您正在使用Android Studio 2.0预览版,我建议您使用“beta”更新频道,而不是“稳定”。它将允许您接收最新的等级配置更改。您可以在设置中更改更新通道-外观和行为-系统设置-更新。选择自动检查更新的[Beta频道]

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.

为了了解gradle类路径和distributionUrl的实际版本(请参阅Nick颈索的答案),您可以创建新的空项目并在那里查看这些值。

#8


2  

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

如果您还在使用以前的版本,那么需要使用2.10的gradle包装吗

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

在android studio中,您可以通过切换到project视图并查看gradle/wrapper/gradle .properties来找到您的包装器

#9


1  

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

您需要更改层叠包装。属性文件在您的应用程序的gradle/wrapper文件夹中,将您的distributionUrl更改为:

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!!!

根据需要使用http:或https:\。然后清理你的项目,你就完成了!!

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

您还可以利用android studio的即时运行特性,这在2.0.0以下的等级版本中是不可用的

#10


1  

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

Android Studio 2.0有一个使用即时运行的更新项目。对于像我这样没有头脑的人:

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

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

The current version of Android Studio 2.0 is Beta 6.

目前的Android Studio 2.0版本是Beta 6。

#11


1  

try update gradle to 2.10

尝试更新等级到2.10

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

对于mac来说,tha path是Android Studio >首选项>构建、执行、部署>构建工具>级

of course you must download gradle 2.10 before

当然,你必须先下载第2.10级

#12


1  

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

我在2016年4月7日的时候也犯了同样的错误,我用“com.android.tools.build:gradle:2.2.0-alpha2”和gradle包装器2.10,我只是换了一个。

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

now I have no problems.

现在我没有问题了。

Hope this help peple.

希望这有助于人。

#13


1  

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. gradle-wrapper开放。属性文件和更改分布url到https\://services.gradle.org/distributions/gradle-2.14.1-all.zip。
  3. Open root level build.gradle and change classpath to com.android.tools.build:gradle:2.2.2.
  4. 构建开放根水平。gradle和更改类路径到com.android.tools.build:gradle:2.2.2。
  5. Sync your Android studio project.
  6. 同步你的Android studio项目。

Reference screen shot:

参考截图:

插件太老了,请更新到最新版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

Done.

完成了。

#14


0  

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

只需更改classpath的com.android.tools.build:gradle:2.0 -alpha或

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

#15


0  

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

我改变了我的类路径,从“com.android.tools.build:gradle:2.2.0-alpha4”

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

类路径的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.

当警告出现“无法找到缓存的类路径”时,单击“try_again”,您只需单击“sync”,就可以轻松地工作了。

#16


0  

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

这个问题通常发生在正在构建项目的IDE(android studio)中,并且项目不是在兼容的gradle插件中。请查看下面的链接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

在我的例子中,我创建了一个项目,使用1.0/2.0版本,然后在studio new中导入它,这给了我错误,然后我在旧版本AS工作时打开了项目。您还可以查看http://tools.android.com/tech-docs/new-build-system

#17


0  

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

>项目结构->项目-> Android插件版本= 2.2.3

Working fine of Android Studio 2.2.3

Android Studio 2.2.3运行良好

#1


131  

UH OH, Google Notice: "This website no longer provides downloads for Android Studio."

哦,谷歌通知:“这个网站不再为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:

您需要更新您正在构建的gradle工具的版本。这可以在您的build.gradle的dependencies部分中找到。你有三个选项可以更新:

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

截至2017年3月2日发布频道引用的最新稳定版本为

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

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

或者是在2017年2月15日通过预览频道发布的最新测试版。

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

而最新的alpha版本也将在2017年3月21日的预览版中提供使用的选项

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:

更新要求您也要升级gradle包装。截至17,17年2月20日,最新的是:

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

在android studio中,您可以通过切换到project视图并查看gradle/wrapper/gradle .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:

有时,在更改包装器之后,项目将无法以“最小支持的Gradle版本2.14.1”这样的错误编译。当前版本是2.10。试着将等级发行版本更改为……“尽管已经有了正确的版本,在gradle-wrapper.properties。如果发生这种情况,请尝试以下方法:

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.

在项目级设置下,确保使用默认的gradle包装(推荐)是所选选项,然后重新构建项目。

(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)

(补充说明:关于alpha和beta版本——在我检查时,并不总是有比稳定版本更新的版本,在这些情况下,我刚刚为前一个版本赋值。如果您在发布版本中遇到问题,可以回滚到该版本)

#2


26  

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.

如果您没有经验,请坚持使用Android Studio的更新稳定频道。我想你是从Canary频道买的。

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.

Android Studio的Canary Channel大约每周提供最新的edge版本。虽然这些构建已经经过了测试,但是它们仍然受到bug的影响,因为我们希望人们尽快看到新的内容。

From: http://tools.android.com/download/studio/canary

来自: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.

您不需要更改旧项目的依赖关系。它们应该在最新版本中正常运行。

#3


12  

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'

#4


7  

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

仅在Windows属性中的高级系统设置中,添加一个名为ANDROID_DAILY_OVERRIDE的新环境变量,并在error message中添加给定值。重新启动android studio,就可以开始了

插件太老了,请更新到最新版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

#5


5  

As of April 5, 2016 this worked for me:

截至2016年4月5日,这对我起了作用:

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

#6


2  

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.

但是它是危险的(将在alpha阶段编码)&也会给出警告。

#7


2  

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]

如果您正在使用Android Studio 2.0预览版,我建议您使用“beta”更新频道,而不是“稳定”。它将允许您接收最新的等级配置更改。您可以在设置中更改更新通道-外观和行为-系统设置-更新。选择自动检查更新的[Beta频道]

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.

为了了解gradle类路径和distributionUrl的实际版本(请参阅Nick颈索的答案),您可以创建新的空项目并在那里查看这些值。

#8


2  

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

如果您还在使用以前的版本,那么需要使用2.10的gradle包装吗

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

在android studio中,您可以通过切换到project视图并查看gradle/wrapper/gradle .properties来找到您的包装器

#9


1  

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

您需要更改层叠包装。属性文件在您的应用程序的gradle/wrapper文件夹中,将您的distributionUrl更改为:

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!!!

根据需要使用http:或https:\。然后清理你的项目,你就完成了!!

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

您还可以利用android studio的即时运行特性,这在2.0.0以下的等级版本中是不可用的

#10


1  

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

Android Studio 2.0有一个使用即时运行的更新项目。对于像我这样没有头脑的人:

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

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

The current version of Android Studio 2.0 is Beta 6.

目前的Android Studio 2.0版本是Beta 6。

#11


1  

try update gradle to 2.10

尝试更新等级到2.10

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

对于mac来说,tha path是Android Studio >首选项>构建、执行、部署>构建工具>级

of course you must download gradle 2.10 before

当然,你必须先下载第2.10级

#12


1  

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

我在2016年4月7日的时候也犯了同样的错误,我用“com.android.tools.build:gradle:2.2.0-alpha2”和gradle包装器2.10,我只是换了一个。

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

now I have no problems.

现在我没有问题了。

Hope this help peple.

希望这有助于人。

#13


1  

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. gradle-wrapper开放。属性文件和更改分布url到https\://services.gradle.org/distributions/gradle-2.14.1-all.zip。
  3. Open root level build.gradle and change classpath to com.android.tools.build:gradle:2.2.2.
  4. 构建开放根水平。gradle和更改类路径到com.android.tools.build:gradle:2.2.2。
  5. Sync your Android studio project.
  6. 同步你的Android studio项目。

Reference screen shot:

参考截图:

插件太老了,请更新到最新版本,或者将ANDROID_DAILY_OVERRIDE环境变量设置为

Done.

完成了。

#14


0  

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

只需更改classpath的com.android.tools.build:gradle:2.0 -alpha或

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

#15


0  

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

我改变了我的类路径,从“com.android.tools.build:gradle:2.2.0-alpha4”

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

类路径的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.

当警告出现“无法找到缓存的类路径”时,单击“try_again”,您只需单击“sync”,就可以轻松地工作了。

#16


0  

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

这个问题通常发生在正在构建项目的IDE(android studio)中,并且项目不是在兼容的gradle插件中。请查看下面的链接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

在我的例子中,我创建了一个项目,使用1.0/2.0版本,然后在studio new中导入它,这给了我错误,然后我在旧版本AS工作时打开了项目。您还可以查看http://tools.android.com/tech-docs/new-build-system

#17


0  

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

>项目结构->项目-> Android插件版本= 2.2.3

Working fine of Android Studio 2.2.3

Android Studio 2.2.3运行良好