Android 库模块开启 isMinifyEnabled=true 时,R8 各自独立混淆, 将内部类重命名为 a.a / a.b 等短名打进 AAR;多个 AAR 合并到 App 时产生 Duplicate class 冲突。 修复:删除全部 7 个库模块 buildTypes.release 中的 isMinifyEnabled, 混淆由 App 的 R8 统一完成。将 proguard-rules.pro 中的保留规则 (manifest 注册类、反射调用入口、dontwarn)合并进各模块的 consumer-rules.pro 随 AAR 打包。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 行
1.1 KiB
Plaintext
49 行
1.1 KiB
Plaintext
plugins {
|
|
alias(libs.plugins.android.library)
|
|
alias(libs.plugins.kotlin.compose)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
}
|
|
|
|
apply(from = rootProject.file("gradle/publish.gradle"))
|
|
|
|
version = providers.gradleProperty("SDK_CORE_VERSION")
|
|
.orElse(providers.gradleProperty("PUBLISH_VERSION"))
|
|
.getOrElse("0.1.0-SNAPSHOT")
|
|
|
|
android {
|
|
namespace = "com.xuqm.sdk.core"
|
|
compileSdk = libs.versions.compileSdk.get().toInt()
|
|
|
|
defaultConfig {
|
|
minSdk = libs.versions.minSdk.get().toInt()
|
|
consumerProguardFiles("consumer-rules.pro")
|
|
}
|
|
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
publishing {
|
|
singleVariant("release") {
|
|
withSourcesJar()
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
api(platform(libs.androidx.compose.bom))
|
|
api(libs.bundles.network)
|
|
api(libs.kotlinx.coroutines.android)
|
|
api(libs.kotlinx.serialization.json)
|
|
api(libs.androidx.core.ktx)
|
|
api(libs.androidx.security.crypto)
|
|
api(libs.androidx.ui)
|
|
api(libs.androidx.material3)
|
|
}
|