在Android Studio 2.0上更新Gradle版本 [英] Update Gradle version on Android Studio 2.0
问题描述
我昨晚将Android Studio更新到了2.0版 然后,我不能再运行应用程序了.我的Android Studio表示
I have updated my Android Studio last night to version 2.0 Then i cannot run app anymore. My Android Studio said that
"此版本的Android Studio与所使用的Gradle插件不兼容.尝试禁用即时运行"(或将IDE或Gradle插件更新为最新版本"
"This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version"
我已经将Gradle更新为最新版本,但不能解决问题.
I already have updated my Gradle to the lastes version but it's don't solve the problem.
这是我的build.gradle.
Here is my build.gradle.
classpath'com.android.tools.build:gradle:2.1.0-alpha1'.
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'.
classpath'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath'me.tatarka:gradle-retrolambda:3.2.0'
classpath 'me.tatarka:gradle-retrolambda:3.2.0'
classpath'com.google.gms:google-services:2.0.0-alpha6'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
还有弯腰
distributionUrl = https://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
推荐答案
始终建议使用稳定版本的Android Gradle插件.因此,将您的项目build.gradle
从classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
更新到稳定版本,然后尝试清理并构建,让我知道后果.
It's always recommended to use stable version of Android Gradle Plugin. So, update your project build.gradle
from classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
to stable version follows.Then try clean and build let me know aftermath.
classpath 'com.android.tools.build:gradle:2.0.0'
这篇关于在Android Studio 2.0上更新Gradle版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!