赞
踩
构建Android项目时卡在Gradle: Download gradle-8.2-src.zip
从 Android Studio Dolphin 2021.3.1 之后,国内源的切换配置就从 build.gradle 文件改到了 settings.gradle 文件。
pluginManagement { repositories { // 改为阿里云的镜像地址 maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/google") } maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://jitpack.io") } maven { setUrl("https://maven.aliyun.com/nexus/content/groups/public/") } maven { setUrl("https://maven.aliyun.com/nexus/content/repositories/jcenter") } gradlePluginPortal() google() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { // 改为阿里云的镜像地址 maven { setUrl("https://maven.aliyun.com/repository/central") } maven { setUrl("https://maven.aliyun.com/repository/jcenter") } maven { setUrl("https://maven.aliyun.com/repository/google") } maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") } maven { setUrl("https://maven.aliyun.com/repository/public") } maven { setUrl("https://jitpack.io") } google() mavenCentral() } } //下面两行用你自己的,不需要改 rootProject.name = "A01_First_App" include(":app")
https://www.sunzhongwei.com/android-studio-settings-gradle-switching-source-in-china
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。