1匿刮、下載自己需要的gradle版本
http://services.gradle.org/distributions/
-
比如說(shuō)僧凰,我需要的是gradle4.4.1版本,點(diǎn)擊下載
-
下載之后放到AS安裝目錄下gradle目錄下熟丸,然后解壓训措,源文件和解壓后的文件都保留
2、配置項(xiàng)目的gradle-wrapper.properties
#Wed Aug 01 14:09:24 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=http\://services.gradle.org/distributions/gradle-2.14.1-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
distributionUrl=file:///C:/soft/it/android/AS/gradle/gradle-4.4.1-all.zip
3光羞、配置Android Studio 的gradle選項(xiàng)隙弛,讓其使用本地的gradle
4、項(xiàng)目的build.gradle選擇對(duì)應(yīng)的Gradle Plugins插件版本
- 對(duì)應(yīng)關(guān)系可以查詢(xún)官網(wǎng)
https://developer.android.google.cn/studio/releases/gradle-plugin.html