From 8cc119af77bc1aa887cf1b9519be9a30ce358c08 Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Tue, 29 Aug 2023 17:22:32 -0400 Subject: [PATCH 1/5] Bump AGP to 8.10 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index cf30ad33..b3596024 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.0.0' + classpath 'com.android.tools.build:gradle:8.1.0' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0' } } From 430943e11d3097cb6302e2bbcafd70670482f5a0 Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Tue, 29 Aug 2023 17:39:20 -0400 Subject: [PATCH 2/5] Add a profiling variant to reproduce release/minified builds without using signing configs --- turbo/build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/turbo/build.gradle b/turbo/build.gradle index d2d6ed51..dd1396ab 100644 --- a/turbo/build.gradle +++ b/turbo/build.gradle @@ -52,6 +52,13 @@ android { } buildTypes { + create("profiling") { + debuggable false + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig getByName("debug").signingConfig + } + release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' From 589d7b79f5f43848d8433d52d89c5f90c71802dc Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Tue, 29 Aug 2023 17:48:42 -0400 Subject: [PATCH 3/5] Fix a known R8 error with a proguard rule --- turbo/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/turbo/proguard-rules.pro b/turbo/proguard-rules.pro index 46d09ad4..58fe3dcd 100644 --- a/turbo/proguard-rules.pro +++ b/turbo/proguard-rules.pro @@ -24,3 +24,6 @@ -keep class sun.misc.Unsafe { *; } -keep class dev.hotwire.turbo.** { *; } + +# Resolve R8 issue: "ERROR: R8: Missing class java.lang.invoke.StringConcatFactory" +-dontwarn java.lang.invoke.StringConcatFactory From 17c78e94242f6a7c8bed0c603b8698e5b1740689 Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Tue, 29 Aug 2023 17:50:23 -0400 Subject: [PATCH 4/5] Bump dependencies --- turbo/build.gradle | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/turbo/build.gradle b/turbo/build.gradle index dd1396ab..94656cad 100644 --- a/turbo/build.gradle +++ b/turbo/build.gradle @@ -79,8 +79,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'org.jetbrains.kotlin:kotlin-reflect:1.8.0' - implementation 'com.google.android.material:material:1.8.0' + implementation 'org.jetbrains.kotlin:kotlin-reflect:1.9.0' + implementation 'com.google.android.material:material:1.9.0' // AndroidX implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -91,12 +91,12 @@ dependencies { implementation 'com.google.code.gson:gson:2.10.1' // Networking/API - implementation 'com.squareup.okhttp3:okhttp:4.10.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.squareup.okhttp3:okhttp:4.11.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.11.0' // Coroutines - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' // Exported AndroidX dependencies api 'androidx.appcompat:appcompat:1.6.1' @@ -111,12 +111,12 @@ dependencies { testImplementation 'androidx.test:core:1.5.0' // Robolectric testImplementation 'androidx.navigation:navigation-testing:2.5.3' testImplementation 'androidx.arch.core:core-testing:2.2.0' - testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' + testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3' testImplementation 'org.assertj:assertj-core:3.24.2' testImplementation 'org.robolectric:robolectric:4.9.2' - testImplementation 'org.mockito:mockito-core:4.11.0' + testImplementation 'org.mockito:mockito-core:5.2.0' testImplementation 'com.nhaarman:mockito-kotlin:1.6.0' - testImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0' + testImplementation 'com.squareup.okhttp3:mockwebserver:4.11.0' testImplementation 'junit:junit:4.13.2' } From c4709d21b4f1d48d5659c4f8f4c9ea3da9e8b608 Mon Sep 17 00:00:00 2001 From: Jay Ohms Date: Tue, 29 Aug 2023 18:13:52 -0400 Subject: [PATCH 5/5] Remove the profiling variant and add the R8 rule to the consumer file --- turbo/build.gradle | 7 ------- turbo/proguard-consumer-rules.pro | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/turbo/build.gradle b/turbo/build.gradle index 94656cad..d3b2078c 100644 --- a/turbo/build.gradle +++ b/turbo/build.gradle @@ -52,13 +52,6 @@ android { } buildTypes { - create("profiling") { - debuggable false - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig getByName("debug").signingConfig - } - release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' diff --git a/turbo/proguard-consumer-rules.pro b/turbo/proguard-consumer-rules.pro index 1339f3e6..2e5a18fb 100644 --- a/turbo/proguard-consumer-rules.pro +++ b/turbo/proguard-consumer-rules.pro @@ -15,3 +15,6 @@ -keep class sun.misc.Unsafe { *; } -keep class dev.hotwire.turbo.** { *; } + +# Resolve R8 issue: "ERROR: R8: Missing class java.lang.invoke.StringConcatFactory" +-dontwarn java.lang.invoke.StringConcatFactory