001 新建项目

2021-05-10  本文已影响0人  卫泽洪_70a7

1、dl.google.com被国内qiang挡住,新建项目之后会有下面的提示窗口:


image.png

其实我不知道为什么会有这玩意,也不知道怎么配置,不管了,,以后再说。

2、新建项目默认的gradle是从网上下载的,很慢,改成自己本地的:


image.png

3、修改gradle 仓库为阿里仓库
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases/' }
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases/' }
maven { url 'https://developer.huawei.com/repo/' }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

上一篇 下一篇

猜你喜欢

热点阅读