問題描述
今天我剛剛從 Android SDK 導入了一個示例應用程序作為我的項目(分析)中的一個模塊,當我嘗試同步它時突然出現這個 gradle 錯誤:插件太舊,請更新到更新版本,或將 ANDROID_DAILY_OVERRIDE 環境變量設置為...
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...
這是我的應用 gradle
文件:
This is my app gradle
file:
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')
}
您是否知道可能是哪個原因(我正在使用插件版本 1.1.0-rc1 和 gradle
版本 2.2 和 Android Studio
版本1.1.0)?
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)?
這是我的頂級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()
}
}
推薦答案
就像 CommonsWare 建議的那樣,確保你有 Gradle 2.2.1+(最新的是 2.3).
Just like CommonsWare suggested, make sure you have Gradle 2.2.1+ (the latest is 2.3).
確保您升級了您的 Android Studio,但這里是需要升級的插件"更新:
Make sure you upgrade your Android Studio but here are the "plugins" that need to be updated:
頂部 build.gradle
:
變化:
classpath 'com.android.tools.build:gradle:1.1.0-rc1'
收件人:
classpath 'com.android.tools.build:gradle:1.1.3' // latest 1.5.0
應用build.gradle
:
變化:
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
收件人:
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
始終檢查 Android SDK 管理器以獲取最新版本:
Always check the Android SDK Manager for the latest revisions:
Android 構建工具插件:http://tools.android.com/tech-docs/new-構建系統
Android Build Tools Plugin: http://tools.android.com/tech-docs/new-build-system
Android 支持庫:http://developer.android.com/tools/support-library/features.html
Android Support Libraries: http://developer.android.com/tools/support-library/features.html
要查看最新的插件版本,請直接查看 Bintray Jcenter 頁面:https://bintray.com/android/android-tools/com.android.tools.build.gradle/view.
To view the latest plugin releases, view the Bintray Jcenter page directly: https://bintray.com/android/android-tools/com.android.tools.build.gradle/view.
這篇關于插件太舊,請更新到最新版本,或將 ANDROID_DAILY_OVERRIDE 環境變量設置為的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!