today I just imported a sample app from Android SDK as a module in my project (analytics) and suddenly I got this gradle error when I try to sync it: Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE envrinment variable to...
今天我刚从Android SDK导入一个样本应用程序作为我的项目(分析)的一个模块,当我试图同步它时,我突然得到了这个gradle错误:插件太旧了,请更新到最近的版本,或者设置ANDROID_DAILY_OVERRIDE envrinment变量到……
This is my app gradle
file:
这是我的app gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "xxx.xxxxxx.xxxxx"
versionCode 1
versionName '1'
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName '1'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
testCompile 'junit:junit:4.12'
compile project(':volley')
}
Do you have any idea of which may be the cause (I'm using the plugin version 1.1.0-rc1 and the gradle
version 2.2 and Android Studio
version 1.1.0)?
您是否知道原因(我使用的是插件版本1.1.0-rc1和gradle版本2.2和Android Studio 1.1.0)?
EDIT:
编辑:
This is my top build.gradle
:
这是我的最高建筑。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0-rc1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
16 个解决方案
#1
132
Just like CommonsWare suggested, make sure you have Gradle 2.2.1+ (the latest is 2.3).
就像CommonsWare建议的那样,确保您有Gradle 2.2.1+(最新的是2.3)。
Make sure you upgrade your Android Studio but here are the "plugins" that need to be updated:
确保你升级了你的安卓工作室,但这里有需要更新的“插件”:
Top build.gradle
:
前build.gradle:
Change:
变化:
classpath 'com.android.tools.build:gradle:1.1.0-rc1'
To:
:
classpath 'com.android.tools.build:gradle:1.1.3' // latest 1.5.0
App build.gradle
:
应用build.gradle:
Change:
变化:
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
To:
:
compile 'com.android.support:recyclerview-v7:22.0.0' // latest 23.1.1
compile 'com.android.support:cardview-v7:22.0.0' // latest 23.1.1
Gradle: https://gradle.org/downloads
Gradle:https://gradle.org/downloads
Always check the Android SDK Manager for the latest revisions:
经常检查Android SDK管理器的最新版本:
Android Build Tools Plugin: http://tools.android.com/tech-docs/new-build-system
Android构建工具插件:http://tools.android.com/techdocs/new - Build -system。
Android Support Libraries: http://developer.android.com/tools/support-library/features.html
Android支持库:http://developer.android.com/tools/support-library/features.html
To view the latest plugin releases, view the Bintray Jcenter page directly: https://bintray.com/android/android-tools/com.android.tools.build.gradle/view.
要查看最新的插件版本,请直接查看Bintray Jcenter页面:https://bintray.com/android/android-tools/com.android.tools.build.gradle/view。
#2
46
Solution (Updated: 24-may-2016): Change build.gradle (project)
解决方案(更新:24- 5 -2016):更改构建。gradle(项目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:X.X.X-lastVersionGradle'
classpath 'com.google.gms:google-services:X.X.X-lastVersionGServices' // If use google-services
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
X.X.X-lastVersionGradle: For example: 2.1.0
X.X.X-lastVersionGradle:例如:魅惑
X.X.X-lastVersionGServices: For example: 3.0.0 (support Firebase Analytics)
X.X.X-lastVersionGServices:例如:3.0.0(支持Firebase分析)
Note: if you're using the google-services plugin has to be the same version (if there)
注意:如果你正在使用google-服务插件,必须是相同的版本(如果有的话)
Warning!! -> 2.2.0-alpha throws Unsupported major.minor version 52.0 if you don't use java JDK 8u91 and NetBeans 8.1
警告! !-> 2.2.0-alpha抛出不支持的专业。如果您不使用java JDK 8u91和NetBeans 8.1,则使用较小的版本52.0。
#3
31
As a side note, I have been getting the same error in completely unrelated situation - after my system clock year setting has been changed (i.e. 2015 -> 2016); changing the clock back to the correct one solved the issue.
作为附注,我在完全不相关的情况下得到了相同的错误——在我的系统时钟年设定发生了变化(即2015 -> 2016);把时钟调回到正确的那个,解决了这个问题。
Note 1: I'm posting this mainly because I had the exactly same error message, but the working solution proven to be different than just updating the plugin's version (as posted by Jared Burrows
).
注意1:我发布这篇文章主要是因为我有完全相同的错误信息,但事实证明,工作解决方案与更新插件版本(由Jared Burrows发布)不同。
Note 2: using
注2:使用
classpath 'com.android.tools.build:gradle:+'
can make the plugin version default to newest one. Bear in mind that your build may break on API changes (and is, for that very reason, discouraged by Android API docs), so use this at your own risk only if you're constantly updating the version anyway.
可以使插件版本默认为最新版本。请记住,您的构建可能会破坏API的更改(出于这个原因,Android API文档不鼓励),所以只有在您不断更新版本的情况下,才可以在自己的风险中使用它。
#4
29
Just in case someone is struggling with this, in my case I'm using Gradle 1.4 beta 1 and I NEED to keep it. So in order to make Android Studio works go to the terminal and run this:
以防有人在纠结这个问题,在我的例子中,我使用的是Gradle 1.4 beta 1,我需要保留它。所以为了让安卓工作室的作品进入终端运行
launchctl setenv ANDROID_DAILY_OVERRIDE <your-value-on-error-message>
launchctl setenv ANDROID_DAILY_OVERRIDE < your-value-on-error-message >
Restart Android Studio and the project will build again.
重新启动Android Studio,项目将重新构建。
Kudos to UPDATE 2 here: https://emmanuelbernard.com/blog/2012/05/09/setting-global-variables-intellij/
在这里更新2:https://emmanuelbernard.com/blog/2012/05/09/settingglobal -variables-intellij/。
#5
15
You can always check the latest gradle plugin version here: https://bintray.com/android/android-tools/com.android.tools.build.gradle
您可以在这里查看最新的gradle插件版本:https://bintray.com/android/android-tools/com.android.tools.build.gradle。
So as of today you should use:
所以今天你应该使用:
classpath 'com.android.tools.build:gradle:2.2.2'
类路径“2.2.2 com.android.tools.build:gradle:”
accordingly.
相应的行动。
#6
9
Replace your class path with something ambiguous like this. Its a solution and it works but it may not be a good solution.
用一些模棱两可的东西替换类路径。它是一个解决方案,但它可能不是一个好的解决方案。
classpath 'com.android.tools.build:gradle:+'
类路径的com.android.tools.build:gradle:+
The best way is replacing the + with the latest version of gradle
最好的方法是用最新版本的gradle代替+。
#7
#8
2
This issue occurs because of the Gradle version changes, since your application uses old version of gradle, you need to update to new version.
这个问题是由于Gradle版本的更改而发生的,因为您的应用程序使用旧版本的Gradle,所以需要更新到新版本。
This changes needs to be done in build.gradle file, have look at this link http://www.feelzdroid.com/2015/11/android-plugin-too-old-update-recent-version.html. to know how to update the gradle and detailed steps are provided. there.
这些更改需要在构建中完成。gradle文件,看看这个链接http://www.feelzdroid.com/2015/11/android-plugin-too-old-update-recent-version.html。了解如何更新分级和详细步骤。在那里。
Thans
谢谢
#9
1
I'm using Android Data Binding and I have the same problem today.
我使用的是Android数据绑定,我今天遇到了同样的问题。
To solve it, change:
为了解决它,改变:
classpath "com.android.databinding:dataBinder:1.0-rc0"
To:
:
classpath "com.android.databinding:dataBinder:1.0-rc1"
1.0-rc0 still could be found on jcenter now, I don't know why it couldn't be use.
现在在jcenter还可以找到1.0-rc0,我不知道为什么它不能使用。
#10
1
I got a way which finally resolve this 1. check your calsspath in the top build.gradle,e.g mine is classpath 'com.android.tools.build:gradle:2.1.0-alpha3' then go to https://jcenter.bintray.com/com/android/tools/build/gradle/ find a release which is newer than yours,here I choose 2.1.0-beta3 change classpath to below, then launch the build. classpath 'com.android.tools.build:gradle:2.1.0-beta3'
我得到了一个最终解决这个问题的方法。检查你的calsspath在顶部的build.gradle,e。在这里,我选择2.1.0-beta3更改类路径到下面,然后启动构建。类路径的com.android.tools.build:gradle:2.1.0-beta3
#11
1
If you want to continue to use the newest development versions then this problem can reoccur each time your version is far enough out of date.
如果您想继续使用最新的开发版本,那么每次您的版本已经过时,这个问题就会重新出现。
I've been keeping an up-to-date list of the most current development versions as well as the stable version on my answer to this similar question, so that I can fix it each time I get a new warning:
我一直在保存最新的开发版本列表,以及我对这个类似问题的回答的稳定版本,以便每次得到新的警告时都能修复它:
Android Studio 2.0 -插件太旧了,请更新到最新版本,或者设置ANDROID_DAILY_OVERRIDE。
#12
0
set Environment variable ANDROID_DAILY_OVERRIDE to same value Example - b9471da4f76e0d1a88d41a072922b1e0c257745c
设置环境变量ANDROID_DAILY_OVERRIDE到相同的值示例- b9471da4f76e0d1a88d41a072922b1e0c257745c。
this works for me.
这适合我。
#13
0
The solution of removing the '-rcX' part works. I wanted to provide some more detail on why the error is happening. The issue is with https://android.googlesource.com/platform/tools/base/+/master/build-system/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.java#230
消除“-rcX”部分的解决方案。我想提供一些关于为什么会发生错误的更详细的信息。这个问题的关键在于https://android.googlesource.com/platform/tools/base/ // master/build-system/gradle/src/main/groovy/ gradle/build/gradle/baseplugin.java #230。
There is a default 40 days 'retirement age' for plugins that don't have a version or contain 'rc', 'alpha', or 'beta'.
对于没有版本或包含“rc”、“alpha”或“beta”的插件,默认设置为40天的退休年龄。
#14
0
In the past months, I used a "preview" version of Android Studio. I tried to switch back to the "stable" releases for the software updates but it wasn't enough and I got this famous error you talk of.
在过去的几个月里,我使用了一个“预览版”的Android Studio。我试着切换到软件更新的“稳定”版本,但这还不够,我还得到了这个著名的错误。
Uninstalling my Android Studio 2.2.preview and installing latest stable Android Studio (2.1) fixed it for me :)
卸载我的Android Studio 2.2。预览和安装最新稳定的Android Studio(2.1)为我修复:
#15
0
Go for stable version or gradle in app level gradle file in my case it was
classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
在我的案例中,在app级别的gradle文件中寻找稳定的版本或gradle,它是classpath的。android。tools.build:gradle:2.2.0-alpha3'
I changed it with
我改变它
classpath 'com.android.tools.build:gradle:2.1.2'
类路径“com.android.tools.build:gradle:2.1.2”
#16
-1
You should upgrade the version of gradle. for example: com.android.build.gradle 1.3.0
您应该升级版本的gradle。例如:com.android.build。1.3.0 gradle版本
this issue occurs when version of the gradle is changed.
这个问题发生在版本的等级被改变的时候。
#1
132
Just like CommonsWare suggested, make sure you have Gradle 2.2.1+ (the latest is 2.3).
就像CommonsWare建议的那样,确保您有Gradle 2.2.1+(最新的是2.3)。
Make sure you upgrade your Android Studio but here are the "plugins" that need to be updated:
确保你升级了你的安卓工作室,但这里有需要更新的“插件”:
Top build.gradle
:
前build.gradle:
Change:
变化:
classpath 'com.android.tools.build:gradle:1.1.0-rc1'
To:
:
classpath 'com.android.tools.build:gradle:1.1.3' // latest 1.5.0
App build.gradle
:
应用build.gradle:
Change:
变化:
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
To:
:
compile 'com.android.support:recyclerview-v7:22.0.0' // latest 23.1.1
compile 'com.android.support:cardview-v7:22.0.0' // latest 23.1.1
Gradle: https://gradle.org/downloads
Gradle:https://gradle.org/downloads
Always check the Android SDK Manager for the latest revisions:
经常检查Android SDK管理器的最新版本:
Android Build Tools Plugin: http://tools.android.com/tech-docs/new-build-system
Android构建工具插件:http://tools.android.com/techdocs/new - Build -system。
Android Support Libraries: http://developer.android.com/tools/support-library/features.html
Android支持库:http://developer.android.com/tools/support-library/features.html
To view the latest plugin releases, view the Bintray Jcenter page directly: https://bintray.com/android/android-tools/com.android.tools.build.gradle/view.
要查看最新的插件版本,请直接查看Bintray Jcenter页面:https://bintray.com/android/android-tools/com.android.tools.build.gradle/view。
#2
46
Solution (Updated: 24-may-2016): Change build.gradle (project)
解决方案(更新:24- 5 -2016):更改构建。gradle(项目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:X.X.X-lastVersionGradle'
classpath 'com.google.gms:google-services:X.X.X-lastVersionGServices' // If use google-services
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
X.X.X-lastVersionGradle: For example: 2.1.0
X.X.X-lastVersionGradle:例如:魅惑
X.X.X-lastVersionGServices: For example: 3.0.0 (support Firebase Analytics)
X.X.X-lastVersionGServices:例如:3.0.0(支持Firebase分析)
Note: if you're using the google-services plugin has to be the same version (if there)
注意:如果你正在使用google-服务插件,必须是相同的版本(如果有的话)
Warning!! -> 2.2.0-alpha throws Unsupported major.minor version 52.0 if you don't use java JDK 8u91 and NetBeans 8.1
警告! !-> 2.2.0-alpha抛出不支持的专业。如果您不使用java JDK 8u91和NetBeans 8.1,则使用较小的版本52.0。
#3
31
As a side note, I have been getting the same error in completely unrelated situation - after my system clock year setting has been changed (i.e. 2015 -> 2016); changing the clock back to the correct one solved the issue.
作为附注,我在完全不相关的情况下得到了相同的错误——在我的系统时钟年设定发生了变化(即2015 -> 2016);把时钟调回到正确的那个,解决了这个问题。
Note 1: I'm posting this mainly because I had the exactly same error message, but the working solution proven to be different than just updating the plugin's version (as posted by Jared Burrows
).
注意1:我发布这篇文章主要是因为我有完全相同的错误信息,但事实证明,工作解决方案与更新插件版本(由Jared Burrows发布)不同。
Note 2: using
注2:使用
classpath 'com.android.tools.build:gradle:+'
can make the plugin version default to newest one. Bear in mind that your build may break on API changes (and is, for that very reason, discouraged by Android API docs), so use this at your own risk only if you're constantly updating the version anyway.
可以使插件版本默认为最新版本。请记住,您的构建可能会破坏API的更改(出于这个原因,Android API文档不鼓励),所以只有在您不断更新版本的情况下,才可以在自己的风险中使用它。
#4
29
Just in case someone is struggling with this, in my case I'm using Gradle 1.4 beta 1 and I NEED to keep it. So in order to make Android Studio works go to the terminal and run this:
以防有人在纠结这个问题,在我的例子中,我使用的是Gradle 1.4 beta 1,我需要保留它。所以为了让安卓工作室的作品进入终端运行
launchctl setenv ANDROID_DAILY_OVERRIDE <your-value-on-error-message>
launchctl setenv ANDROID_DAILY_OVERRIDE < your-value-on-error-message >
Restart Android Studio and the project will build again.
重新启动Android Studio,项目将重新构建。
Kudos to UPDATE 2 here: https://emmanuelbernard.com/blog/2012/05/09/setting-global-variables-intellij/
在这里更新2:https://emmanuelbernard.com/blog/2012/05/09/settingglobal -variables-intellij/。
#5
15
You can always check the latest gradle plugin version here: https://bintray.com/android/android-tools/com.android.tools.build.gradle
您可以在这里查看最新的gradle插件版本:https://bintray.com/android/android-tools/com.android.tools.build.gradle。
So as of today you should use:
所以今天你应该使用:
classpath 'com.android.tools.build:gradle:2.2.2'
类路径“2.2.2 com.android.tools.build:gradle:”
accordingly.
相应的行动。
#6
9
Replace your class path with something ambiguous like this. Its a solution and it works but it may not be a good solution.
用一些模棱两可的东西替换类路径。它是一个解决方案,但它可能不是一个好的解决方案。
classpath 'com.android.tools.build:gradle:+'
类路径的com.android.tools.build:gradle:+
The best way is replacing the + with the latest version of gradle
最好的方法是用最新版本的gradle代替+。
#7
6
Check the latest version of Gradle Plugin Here:
查看最新版本的Gradle插件:
You should change this in dependencies of app settings
您应该在应用程序设置的依赖关系中更改这个。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:[PLACE VERSION CODE HERE]'
}
}
}
#8
2
This issue occurs because of the Gradle version changes, since your application uses old version of gradle, you need to update to new version.
这个问题是由于Gradle版本的更改而发生的,因为您的应用程序使用旧版本的Gradle,所以需要更新到新版本。
This changes needs to be done in build.gradle file, have look at this link http://www.feelzdroid.com/2015/11/android-plugin-too-old-update-recent-version.html. to know how to update the gradle and detailed steps are provided. there.
这些更改需要在构建中完成。gradle文件,看看这个链接http://www.feelzdroid.com/2015/11/android-plugin-too-old-update-recent-version.html。了解如何更新分级和详细步骤。在那里。
Thans
谢谢
#9
1
I'm using Android Data Binding and I have the same problem today.
我使用的是Android数据绑定,我今天遇到了同样的问题。
To solve it, change:
为了解决它,改变:
classpath "com.android.databinding:dataBinder:1.0-rc0"
To:
:
classpath "com.android.databinding:dataBinder:1.0-rc1"
1.0-rc0 still could be found on jcenter now, I don't know why it couldn't be use.
现在在jcenter还可以找到1.0-rc0,我不知道为什么它不能使用。
#10
1
I got a way which finally resolve this 1. check your calsspath in the top build.gradle,e.g mine is classpath 'com.android.tools.build:gradle:2.1.0-alpha3' then go to https://jcenter.bintray.com/com/android/tools/build/gradle/ find a release which is newer than yours,here I choose 2.1.0-beta3 change classpath to below, then launch the build. classpath 'com.android.tools.build:gradle:2.1.0-beta3'
我得到了一个最终解决这个问题的方法。检查你的calsspath在顶部的build.gradle,e。在这里,我选择2.1.0-beta3更改类路径到下面,然后启动构建。类路径的com.android.tools.build:gradle:2.1.0-beta3
#11
1
If you want to continue to use the newest development versions then this problem can reoccur each time your version is far enough out of date.
如果您想继续使用最新的开发版本,那么每次您的版本已经过时,这个问题就会重新出现。
I've been keeping an up-to-date list of the most current development versions as well as the stable version on my answer to this similar question, so that I can fix it each time I get a new warning:
我一直在保存最新的开发版本列表,以及我对这个类似问题的回答的稳定版本,以便每次得到新的警告时都能修复它:
Android Studio 2.0 -插件太旧了,请更新到最新版本,或者设置ANDROID_DAILY_OVERRIDE。
#12
0
set Environment variable ANDROID_DAILY_OVERRIDE to same value Example - b9471da4f76e0d1a88d41a072922b1e0c257745c
设置环境变量ANDROID_DAILY_OVERRIDE到相同的值示例- b9471da4f76e0d1a88d41a072922b1e0c257745c。
this works for me.
这适合我。
#13
0
The solution of removing the '-rcX' part works. I wanted to provide some more detail on why the error is happening. The issue is with https://android.googlesource.com/platform/tools/base/+/master/build-system/gradle/src/main/groovy/com/android/build/gradle/BasePlugin.java#230
消除“-rcX”部分的解决方案。我想提供一些关于为什么会发生错误的更详细的信息。这个问题的关键在于https://android.googlesource.com/platform/tools/base/ // master/build-system/gradle/src/main/groovy/ gradle/build/gradle/baseplugin.java #230。
There is a default 40 days 'retirement age' for plugins that don't have a version or contain 'rc', 'alpha', or 'beta'.
对于没有版本或包含“rc”、“alpha”或“beta”的插件,默认设置为40天的退休年龄。
#14
0
In the past months, I used a "preview" version of Android Studio. I tried to switch back to the "stable" releases for the software updates but it wasn't enough and I got this famous error you talk of.
在过去的几个月里,我使用了一个“预览版”的Android Studio。我试着切换到软件更新的“稳定”版本,但这还不够,我还得到了这个著名的错误。
Uninstalling my Android Studio 2.2.preview and installing latest stable Android Studio (2.1) fixed it for me :)
卸载我的Android Studio 2.2。预览和安装最新稳定的Android Studio(2.1)为我修复:
#15
0
Go for stable version or gradle in app level gradle file in my case it was
classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
在我的案例中,在app级别的gradle文件中寻找稳定的版本或gradle,它是classpath的。android。tools.build:gradle:2.2.0-alpha3'
I changed it with
我改变它
classpath 'com.android.tools.build:gradle:2.1.2'
类路径“com.android.tools.build:gradle:2.1.2”
#16
-1
You should upgrade the version of gradle. for example: com.android.build.gradle 1.3.0
您应该升级版本的gradle。例如:com.android.build。1.3.0 gradle版本
this issue occurs when version of the gradle is changed.
这个问题发生在版本的等级被改变的时候。