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>
58 行
1.5 KiB
Plaintext
58 行
1.5 KiB
Plaintext
plugins {
|
|
id("com.android.library")
|
|
id("maven-publish")
|
|
}
|
|
|
|
group = rootProject.group
|
|
|
|
android {
|
|
namespace = "com.xuqm.sdk.bugcollect"
|
|
compileSdk = 36
|
|
defaultConfig {
|
|
minSdk = 24
|
|
consumerProguardFiles("consumer-rules.pro")
|
|
}
|
|
|
|
|
|
publishing { singleVariant("release") { withSourcesJar() } }
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|
|
val sdkBugCollectVersion: String by lazy {
|
|
(project.findProperty("SDK_BUGCOLLECT_VERSION") as? String)?.takeIf { it.isNotBlank() }
|
|
?: (project.findProperty("PUBLISH_VERSION") as? String)?.takeIf { it.isNotBlank() }
|
|
?: "0.0.1-SNAPSHOT"
|
|
}
|
|
|
|
afterEvaluate {
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("release") {
|
|
from(components["release"])
|
|
groupId = "com.xuqm"
|
|
artifactId = "sdk-bugcollect"
|
|
version = sdkBugCollectVersion
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url = uri(rootProject.ext["nexusUrl"] as String)
|
|
credentials {
|
|
username = project.findProperty("NEXUS_USER") as? String ?: ""
|
|
password = project.findProperty("NEXUS_PASSWORD") as? String ?: ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":sdk-core"))
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
implementation("com.google.code.gson:gson:2.10.1")
|
|
}
|