本文主要是介绍Andriod Studio-gradle build时间过长解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在创建好的项目文件夹内,找到build.gradle文件,使用notepad打开文件,将repositories代码原内容注释,改为以下部分代码:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {repositories {//google()//mavenCentral()maven { url 'https://plugins.gradle.org/m2/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin'}}dependencies {classpath "com.android.tools.build:gradle:7.0.4"classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files}
}task clean(type: Delete) {delete rootProject.buildDir
}
这篇关于Andriod Studio-gradle build时间过长解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!