fix: R8 Full Mode 导致 Release 闪退

This commit is contained in:
HuanCheng65 2023-09-21 19:25:58 +08:00
parent 87a6d01593
commit 114dba3e00
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
3 changed files with 20 additions and 5 deletions

View File

@ -123,7 +123,7 @@ dependencies {
implementation "com.airbnb.android:lottie:$lottie_version" implementation "com.airbnb.android:lottie:$lottie_version"
implementation "com.airbnb.android:lottie-compose:$lottie_version" implementation "com.airbnb.android:lottie-compose:$lottie_version"
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1' implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5' implementation 'org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5'
// implementation 'androidx.compose.material3:material3:1.0.0' // implementation 'androidx.compose.material3:material3:1.0.0'
@ -237,7 +237,7 @@ dependencies {
implementation "com.google.android.material:material:1.9.0" implementation "com.google.android.material:material:1.9.0"
implementation "com.squareup.okhttp3:okhttp:4.10.0" implementation 'com.squareup.okhttp3:okhttp:4.11.0'
implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.retrofit2:converter-wire:$retrofit_version" implementation "com.squareup.retrofit2:converter-wire:$retrofit_version"

View File

@ -256,3 +256,18 @@
void traceEventStart(int,java.lang.String); void traceEventStart(int,java.lang.String);
void traceEventEnd(); void traceEventEnd();
} }
# Keep generic signature of Flow (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking class kotlinx.coroutines.flow.Flow
-keep,allowobfuscation,allowshrinking class * extends kotlinx.coroutines.flow.Flow
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

View File

@ -2,15 +2,15 @@
buildscript { buildscript {
ext { ext {
glide_version = '4.15.1' glide_version = '4.16.0'
retrofit_version = "2.9.0" retrofit_version = "2.9.0"
kotlin_version = '1.9.10' kotlin_version = '1.9.10'
coroutines_version = '1.7.2' coroutines_version = '1.7.3'
//https://developer.android.com/jetpack/androidx/releases/compose-kotlin //https://developer.android.com/jetpack/androidx/releases/compose-kotlin
compose_compiler_version = '1.5.3' compose_compiler_version = '1.5.3'
//https://developer.android.com/jetpack/compose/setup#bom-version-mapping //https://developer.android.com/jetpack/compose/setup#bom-version-mapping
compose_bom_version = '2023.09.01' compose_bom_version = '2023.09.01'
wire_version = '4.7.2' wire_version = '4.9.0'
hilt_version = '2.46.1' hilt_version = '2.46.1'
booster_version = '4.16.2' booster_version = '4.16.2'
lottie_version = '6.1.0' lottie_version = '6.1.0'