Gradle: Download 下载慢的解决办法

https://maven.aliyun.com/mvn/guide

仓库名称

阿里云仓库地址

阿里云仓库地址(老版)

源地址

central

https://maven.aliyun.com/repository/central

https://maven.aliyun.com/nexus/content/repositories/central

https://repo1.maven.org/maven2/

jcenter

https://maven.aliyun.com/repository/public

https://maven.aliyun.com/nexus/content/repositories/jcenter

http://jcenter.bintray.com/

public

https://maven.aliyun.com/repository/public

https://maven.aliyun.com/nexus/content/groups/public

central仓和jcenter仓的聚合仓

google

https://maven.aliyun.com/repository/google

https://maven.aliyun.com/nexus/content/repositories/google

https://maven.google.com/

gradle-plugin

https://maven.aliyun.com/repository/gradle-plugin

https://maven.aliyun.com/nexus/content/repositories/gradle-plugin

https://plugins.gradle.org/m2/

spring

https://maven.aliyun.com/repository/spring

https://maven.aliyun.com/nexus/content/repositories/spring

http://repo.spring.io/libs-milestone/

spring-plugin

https://maven.aliyun.com/repository/spring-plugin

https://maven.aliyun.com/nexus/content/repositories/spring-plugin

http://repo.spring.io/plugins-release/

grails-core

https://maven.aliyun.com/repository/grails-core

https://maven.aliyun.com/nexus/content/repositories/grails-core

https://repo.grails.org/grails/core

apache snapshots

https://maven.aliyun.com/repository/apache-snapshots

https://maven.aliyun.com/nexus/content/repositories/apache-snapshots

https://repository.apache.org/snapshots/

引用上面的阿里云仓库地址就行了,速度杠杆的

例如:

buildscript {
    repositories {
//        google()
//        jcenter()
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        maven{ url 'https://maven.aliyun.com/repository/google'}
    }
    dependencies {
        classpath 'com.android.tools:r8:2.1.75'
        classpath 'com.android.tools.build:gradle:4.0.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // 添加emas-services插件
        classpath 'com.aliyun.ams:emas-services:1.0.1'
        //添加AndResGuard依赖
        classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.20'
        //添加华为推送依赖
        classpath 'com.huawei.agconnect:agcp:1.3.1.300'
        classpath 'com.didichuxing.doraemonkit:dokitx-plugin:3.3.5'
        //添加多渠道依赖
        classpath 'com.leon.channel:plugin:2.0.3'
    }
}

allprojects {
    repositories {
//        google()
//        jcenter()
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        maven{ url 'https://maven.aliyun.com/repository/google'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
### 回答1: 要下载build:gradle:3.6.1,您可以按照以下步骤操作: 1. 打开您的项目文件夹,找到项目的build.gradle文件。 2. 在build.gradle文件中找到dependencies部分。 3. 在dependencies部分中添加以下代码: ``` classpath 'com.android.tools.build:gradle:3.6.1' ``` 4. 保存并关闭build.gradle文件。 5. 在Android Studio中,打开Gradle面板(在右侧的边栏中)。 6. 在Gradle面板中,展开您的项目,找到build.gradle文件。 7. 右键单击build.gradle文件,然后选择“Reload Gradle Project”。 8. Gradle将开始下载并安装build:gradle:3.6.1。您可以在Gradle控制台中查看下载进度。 9. 下载完成后,您可以在Gradle面板中看到build:gradle:3.6.1已经被添加到您的项目中。 请注意,如果您使用的是其他构建工具或IDE,下载步骤可能会略有不同。 ### 回答2: 要下载build.gradle:3.6.1,您可以按照以下步骤进行操作: 1. 首先,打开一个支持Gradle构建的项目,并确保您的计算机已经安装了Gradle构建工具。 2. 接下来,打开您的项目根目录中的build.gradle文件,该文件位于项目的顶级目录。 3. 在build.gradle文件中,找到buildscript部分,它通常在脚本的顶部。在该部分中,您将找到对Gradle版本的声明。 4. 确保Gradle的版本声明看起来像下面这样: buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.1' } } 5. 如果版本声明中的Gradle版本不是3.6.1,则将其更改为3.6.1。 6. 保存并关闭build.gradle文件。 7. 现在,返回到命令行界面或终端,并导航到您的项目目录。 8. 在命令行中,运行以下命令来下载并安装Gradle 3.6.1: ./gradlew wrapper --gradle-version 3.6.1 9. 等待Gradle安装完成。一旦安装完成,您的项目将具备了使用Gradle 3.6.1进行构建的能力。 请注意,如果您使用的是Android Studio等集成开发环境(IDE),它通常会自动下载和管理Gradle版本。在这种情况下,您只需要在IDE中更新Gradle版本即可,而不需要手动下载版本。 ### 回答3: build.gradleAndroid项目中的一个配置文件,它包含了关于项目的各种设置和依赖项的信息。而gradle是一种项目构建工具,用于自动化构建、测试和部署应用程序。 build.gradle:3.6.1表示使用Gradle的版本号为3.6.1。在下载该版本的Gradle之前,可以去官方网站(https://gradle.org/releases/)下载并安装Gradle。也可以通过在线构建工具或者像JCenter、Maven Central这样的仓库来获取所需的构建工具。 下载build.gradle:3.6.1的步骤如下: 1. 打开Gradle官方网站,找到3.6.1版本的Gradle。 2. 点击下载按钮,选择适合您操作系统的版本进行下载。 3. 下载完成后,解压缩文件到指定位置。 4. 配置Gradle的环境变量,以便在命令行中可以直接使用Gradle命令。 下载Gradle后,需要将其与Android项目关联起来。在Android项目的根目录下找到build.gradle文件,并将其编辑为如下所示: ``` buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.1' } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } ``` 在dependencies中添加了classpath 'com.android.tools.build:gradle:3.6.1',这将确保Android Studio在构建过程中使用指定版本的Gradle。 完成以上操作后,重新打开Android Studio,它会自动检测并加载新的Gradle版本。至此,您成功下载并配置了build.gradle:3.6.1。通过Gradle的强大功能,您可以更轻松地构建、测试和部署Android应用程序。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值