// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() maven { url 'https://maven.aliyun.com/repository/central' } mavenLocal() mavenCentral() google() // jcenter() maven { url 'https://maven.aliyun.com/repository/google/' } maven { url 'https://maven.aliyun.com/repository/jcenter/' } maven { url 'https://jitpack.io' } maven { url 'https://developer.huawei.com/repo/' } maven { url 'https://repo1.maven.org/maven2/' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } } dependencies { classpath 'com.android.tools.build:gradle:8.7.3' classpath 'com.huawei.agconnect:agcp:1.4.1.300' // Kotlin Gradle 插件 - AGP 8.7.3 需要 Kotlin 1.9.0+ classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() maven { url 'https://maven.aliyun.com/repository/central' } mavenLocal() mavenCentral() // jcenter() 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/' } maven { url 'https://jitpack.io' } // maven { // url "https://dl.bintray.com/pingxx/maven" // } maven { url 'https://repo1.maven.org/maven2/' } //新浪 // maven { url "https://dl.bintray.com/thelasterstar/maven/" } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } //阿里云效仓库,必须添加 maven { credentials { username '609cc5623a10edbf36da9615' password 'EbkbzTNHRJ=P' } url 'https://packages.aliyun.com/maven/repository/2102846-release-8EVsoM/' } } // 解决 Kotlin 标准库版本冲突 // 从 Kotlin 1.8.0 开始,kotlin-stdlib-jdk7 和 kotlin-stdlib-jdk8 已合并到 kotlin-stdlib configurations.all { exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7' exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8' // 统一 Kotlin 标准库版本为 1.9.22(与 AGP 8.7.3 兼容) resolutionStrategy.eachDependency { DependencyResolveDetails details -> if (details.requested.group == 'org.jetbrains.kotlin' && details.requested.name == 'kotlin-stdlib') { details.useVersion '1.9.22' } } } } task clean(type: Delete) { delete rootProject.buildDir }