关键词:安卓,Android,AndroidStudio,gradle
主要原因还是墙的问题,设置国内镜像即可。参考:阿里云Maven仓库服务 设置build.gradle
:
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/google' } //google
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url "https://jitpack.io" }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
// 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' } //google
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url "https://jitpack.io" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
文档信息
- 本文作者:zhupite
- 本文链接:https://zhupite.com/android/android-studio-gradle-speed-up.html
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)