From 2885b2aabbbf47aba7bf12b1cd7cbc03b1f5ec15 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 2 Feb 2024 20:17:19 +0800 Subject: [PATCH] chore: fix R8 not working --- app/build.gradle.kts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 94159537..2b61dd53 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -54,34 +54,35 @@ android { compose = true } signingConfigs { - println("keystore.file: ${property.keystore.file}") if (property.keystore.file.isNotBlank()) { - val config by creating { + create("config") { storeFile = file(File(rootDir, property.keystore.file)) storePassword = property.keystore.password keyAlias = property.keystore.key.alias keyPassword = property.keystore.key.password + enableV1Signing = true + enableV2Signing = true enableV3Signing = true enableV4Signing = true } } } buildTypes { - configureEach { + all { signingConfig = - if (signingConfigs.any { it.name == "config" }) signingConfigs.getByName("config") else signingConfigs.getByName( - "debug" - ) + if (signingConfigs.any { it.name == "config" }) + signingConfigs.getByName("config") + else signingConfigs.getByName("debug") } - val release by getting { + release { isMinifyEnabled = true isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - isDebuggable = true - isJniDebuggable = true + isDebuggable = false + isJniDebuggable = false multiDexEnabled = true } }