From 034a63bcee3945e0d8d721068e286951e7a43c3f Mon Sep 17 00:00:00 2001 From: Kevin Puertas Date: Wed, 21 Oct 2026 00:13:07 +0200 Subject: [PATCH] Toolchain: Gradle 9.6 + AGP 9.4.1 (Kotlin built-in) y R8 en release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sin plugin kotlin-android (built-in), DSL kotlin.compilerOptions, sourceSets legacy fuera, jetifier fuera, jvmTarget 17. Release con minify+shrink y reglas keep para WorkManager/Room de play-services-ads (reflexión rota por R8). --- app/build.gradle | 23 +++++++++---------- app/proguard-rules.pro | 29 +++++------------------- build.gradle | 3 +-- gradle.properties | 1 - gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 19 insertions(+), 39 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0036f2a..8dbd316 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,5 @@ plugins { id 'com.android.application' - id 'kotlin-android' } // Credenciales de firma de release: viven en keystore.properties (ignorado por git). @@ -17,7 +16,7 @@ android { defaultConfig { applicationId "com.jkanetwork.st.frasesdeanime" - minSdk 24 + minSdk 26 targetSdk 36 // Sube automáticamente la build en cada compilacion def versionPropsFile = file('versioncode.count') @@ -43,9 +42,9 @@ android { } buildTypes { release { - minifyEnabled false - shrinkResources false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' if (keystorePropsFile.exists()) { signingConfig signingConfigs.release } @@ -55,16 +54,16 @@ android { viewBinding true } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } } -sourceSets { - main.java.srcDirs += 'src/main/kotlin' +// AGP 9: DSL kotlinOptions -> kotlin.compilerOptions (built-in Kotlin) +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } } dependencies { diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index daf2ee3..52cd314 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,25 +1,8 @@ # Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /home/kprkpr/AndroidStudio/sdkLinux/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile +# WorkManager llega vía play-services-ads e instancia su BD Room +# (androidx.work.impl.WorkDatabase_Impl) por reflexión; el R8 optimizador +# rompe ese constructor si no se conserva. +-keep class androidx.work.** { *; } +-keep class * extends androidx.room.RoomDatabase { (...); } +-dontwarn androidx.work.** diff --git a/build.gradle b/build.gradle index b876902..64529f8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.10.0' apply false - id 'org.jetbrains.kotlin.android' version '2.2.10' apply false + id 'com.android.application' version '9.4.1' apply false } diff --git a/gradle.properties b/gradle.properties index abcb15b..2282365 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,5 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Tue Nov 14 12:27:09 CET 2017 -android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 81aa1c0..f0f17c3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists