2025-11-24 15:05:20 +08:00

62 lines
1.9 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

buildscript {
// 1. 修改这里:将 Kotlin 版本升级到 1.9.24 以解决 "Module was compiled with... 1.9.0" 报错
ext.kotlin_version = '1.9.24'
repositories {
// 2. 优化网络:优先使用阿里云镜像,解决下载慢/超时/握手失败问题
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
mavenCentral()
}
dependencies {
// Android Gradle 插件版本 (保持您当前的 7.3.0 即可,如果报错提示不兼容再升级到 7.4.2)
classpath 'com.android.tools.build:gradle:7.3.0'
// Kotlin 插件 (这里引用了上面定义的 ext.kotlin_version)
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
// === 本地 AAR 调试配置 ===
// 启用本地调试: 取消下面这行的注释
// maven { url 'file://' + projectDir.absolutePath + '/local-maven' }
// === 本地 AAR 配置结束 ===
// 3. 优化网络allprojects 也要加镜像
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
mavenCentral()
}
}
// === 强制使用本地 AAR 版本 (调试时取消注释) ===
// 注意: 必须配合上面的本地 Maven 仓库一起使用
// configurations.all {
// resolutionStrategy {
// force 'com.openim:sdkcore:1.0.15-local'
// }
// }
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}