其他分享
首页 > 其他分享> > 开发Jetpack Compose应用,解决Android Studio配置完Kotlin下载慢的问题

开发Jetpack Compose应用,解决Android Studio配置完Kotlin下载慢的问题

作者:互联网

修改项目(而非模块)build.gradle文件,如下:

buildscript {
ext {
compose_version = '1.1.1'
kotlin_version = '1.6.21'
}
repositories {
// 以下四行添加阿里云的仓库地址,方便国内开发者下载相关插件
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
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/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google'}
maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven { url 'https://maven.aliyun.com/repository/public'}
google()
mavenCentral()
}
}

标签:Compose,aliyun,repository,url,Jetpack,maven,Studio,https,com
来源: https://www.cnblogs.com/zdt168/p/16314626.html