chore: fix R8 not working

This commit is contained in:
HuanCheng65 2024-02-02 20:17:19 +08:00
parent 6b5b221422
commit 2885b2aabb
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 10 additions and 9 deletions

View File

@ -54,34 +54,35 @@ android {
compose = true compose = true
} }
signingConfigs { signingConfigs {
println("keystore.file: ${property.keystore.file}")
if (property.keystore.file.isNotBlank()) { if (property.keystore.file.isNotBlank()) {
val config by creating { create("config") {
storeFile = file(File(rootDir, property.keystore.file)) storeFile = file(File(rootDir, property.keystore.file))
storePassword = property.keystore.password storePassword = property.keystore.password
keyAlias = property.keystore.key.alias keyAlias = property.keystore.key.alias
keyPassword = property.keystore.key.password keyPassword = property.keystore.key.password
enableV1Signing = true
enableV2Signing = true
enableV3Signing = true enableV3Signing = true
enableV4Signing = true enableV4Signing = true
} }
} }
} }
buildTypes { buildTypes {
configureEach { all {
signingConfig = signingConfig =
if (signingConfigs.any { it.name == "config" }) signingConfigs.getByName("config") else signingConfigs.getByName( if (signingConfigs.any { it.name == "config" })
"debug" signingConfigs.getByName("config")
) else signingConfigs.getByName("debug")
} }
val release by getting { release {
isMinifyEnabled = true isMinifyEnabled = true
isShrinkResources = true isShrinkResources = true
proguardFiles( proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro" "proguard-rules.pro"
) )
isDebuggable = true isDebuggable = false
isJniDebuggable = true isJniDebuggable = false
multiDexEnabled = true multiDexEnabled = true
} }
} }