Android Studio 2.0-插件版本太旧,请更新至最新版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为 [英] Android Studio 2.0 - Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

查看:131
本文介绍了Android Studio 2.0-插件版本太旧,请更新至最新版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我意识到只有在创建新项目时才会出现此问题.在以前开发的项目中,不会发生此问题,并且我意识到gradle是不同的 classpath 'com.android.tools.build:gradle:1.3.0'.

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?

我的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'
}

我的build.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
}

推荐答案

UH OH,Google通知:该网站不再提供Android Studio的下载."

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)

您需要更新用于构建的gradle工具的版本.可以在build.gradle的"dependencies"部分中找到. 您可以更新3个选项:

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:

发行渠道中引用的最新稳定版本.截至2017年3月2日是

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 通过 最新的 alpha版本,也来自

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' 

更新还要求您还升级渐变包装器. 截止到17年2月20日,最新信息是:

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

在android studio上,您可以通过更改为项目视图并在gradle/wrapper/gradle-wrapper.properties

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

有时,更改包装器后,尽管gradle-wrapper.properties中已经具有正确的版本,但项目仍无法编译,并出现类似Minimum supported Gradle version is 2.14.1. Current version is 2.10. Try changing Gradle distribution version to...的错误.如果发生这种情况,请尝试以下操作:

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

Go to Settings > Build, Execution, Deployment > Gradle

Project-level settings下,确保选择使用默认gradle包装器(推荐),然后重新构建项目.

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

(附加说明:关于alpha和beta版本-当我检查时,并不总是比稳定版本更新的版本,在这种情况下,我只是为先前版本提供了值.这允许如果您遇到发行版的问题,则可以回滚到该版本)

这篇关于Android Studio 2.0-插件版本太旧,请更新至最新版本,或将ANDROID_DAILY_OVERRIDE环境变量设置为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆