問題描述
因為我一直在使用
classpath 'com.android.tools.build:gradle:+'
在 build.gradle 文件中,由于 gradle version 2.10 已發布,我收到以下錯誤.錯誤是:
In the build.gradle file, I got the following error since gradle version 2.10 has been released. The error is :
警告:需要 Gradle 版本 2.10.當前版本是 2.8.如果使用 gradle 包裝器,嘗試編輯 distributionUrlC:Userslahblahmyprojectgradlewrappergradle-wrapper.properties到 gradle-2.10-all.zip
Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:Userslahblahmyprojectgradlewrappergradle-wrapper.properties to gradle-2.10-all.zip
起初看起來很容易通過指南解決,但是當我完成更改后,我又遇到了錯誤.
at first it looks easy to solve by the guide, but when I'd done the change, I got the error again.
我正在使用 Android Studio 2.0 和最新的 Android SDK Tools 24.4.1 和 Android SDK Build Tools 23.0.2
I'm using Android Studio 2.0 with the latest Android SDK Tools 24.4.1 and Android SDK Build Tools 23.0.2
我什至嘗試下載 Gradle 2.10 并將其手動放在 android-studiogradle 文件夾中,但沒有成功.
I've even tried to download Gradle 2.10 and put it manually on android-studiogradle folder, but no luck.
任何幫助將不勝感激.
推薦答案
你需要改變 File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home 路徑
在 Mac OS 上,在 Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home 中更改路徑
On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home
或者設置使用默認的gradle wrapper并像這樣編輯Projectgradlewrappergradle-wrapper.properties
文件字段distributionUrl
p>
Or set Use default gradle wrapper and edit Projectgradlewrappergradle-wrapper.properties
files field distributionUrl
like this
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
這篇關于“需要 Gradle 版本 2.10."錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!