Android Studio 4.0 设置代理proxy和maven
程序员文章站
2022-05-04 07:56:57
...
系统 Windows 10
Android Studio 4.0.1
1.设置proxy,能够使得下载SDK,NDK等速度变快。File->Settings 然后可以看到下面页面
下面这张图修改的是局部,全局文件位置为
C:\Users\UserName\.gradle\gradle.properties
2.设置maven能使项目build时安装依赖项的速度提高
build.gradle(Project:XXXXXX)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
maven{
url "https://maven.aliyun.com/groups/public"
}
maven {
url "https://maven.aliyun.com/repository/google"
}
maven {
url "https://maven.aliyun.com/repository/jcenter"
}
// google()
// jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
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
}
}
allprojects {
repositories {
maven{
url "https://maven.aliyun.com/groups/public"
}
maven {
url "https://maven.aliyun.com/repository/google"
}
maven {
url "https://maven.aliyun.com/repository/jcenter"
}
// google()
// jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
参考文献:
上一篇: PHP如何利用空值检测函数