project下的build.gradle:?文章來源:http://www.zghlxwxcb.cn/news/detail-846305.html
// Top-level build file where you can add configuration options common to all sub-projects/modules. // 注意jdk版本需要17以上,因為8.1.3的gradle需要jdk17以上 //plugins { // id 'com.android.application' version '8.1.3' apply false //} buildscript { repositories { maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } google() } dependencies { classpath 'com.android.tools.build:gradle:8.1.3' } } // 下面這個allprojects不需要,舊版的需要這個 //allprojects { // repositories { // maven { url 'https://maven.aliyun.com/repository/central' } // maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } // maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } // maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } // maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } // google() // } //} task clean(type: Delete) { delete rootProject.buildDir }
gradle.properties配置如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-846305.html
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists # 下面這里改用騰訊的鏡像會快很多 distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
到了這里,關(guān)于新版AndroidStudio配置maven阿里云鏡像的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!