allprojects { repositories { maven { url 'https://repo.huaweicloud.com/repository/maven/' } maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/center' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://jitpack.io' } maven { url 'https://developer.huawei.com/repo/'} google() mavenCentral() flatDir { dirs 'libs' } } // 修复由于高版本导致namespace检测为空的问题,没遇到可不添加 subprojects { afterEvaluate { project -> if (project.hasProperty('android')) { project.android { if (namespace == null) { namespace project.group } } } // 指定Kotilin的jvm版本与编译版本 def javaVersion = JavaVersion.VERSION_1_8 android { compileOptions { sourceCompatibility javaVersion targetCompatibility javaVersion } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { jvmTarget = javaVersion.toString() } } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach { kotlinOptions { jvmTarget = javaVersion.toString() } } } } } // 修复由于高版本导致namespace检测为空的问题,没遇到可不添加 } rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { delete rootProject.buildDir } buildscript { repositories { google() mavenCentral() maven {url 'https://developer.huawei.com/repo/'} } } buildscript { dependencies { classpath 'com.android.tools.build:gradle:8.2.1' classpath 'com.huawei.agconnect:agcp:1.9.1.301' } }