android / kotlin-multiplatform-samples

Samples showcasing the experimental Kotlin Multiplatform Jetpack libraries
https://androidx.github.io/kmp-eap-docs/
Apache License 2.0
916 stars 83 forks source link

App crash in release mode due to Proguard obfuscation #13

Closed AzimAnsari closed 6 days ago

AzimAnsari commented 1 year ago

isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" )

Enabling Proguard optimisation crashed the app with below stack trace

E FATAL EXCEPTION: DefaultDispatcher-worker-2 Process: com.google.samples.apps.diceroller, PID: 8896 java.lang.RuntimeException: Field value_ for e2.c not found. Known fields are [public int e2.c.m, public java.lang.Object e2.c.n, public static final e2.c e2.c.o, public static volatile g2.v$b e2.c.p] at g2.r0.H(Unknown Source:69) at g2.r0.z(Unknown Source:615) at g2.x0.a(Unknown Source:194) at g2.v$a.i(Unknown Source:25) at g2.v$a.h(Unknown Source:0) at f2.g.c(Unknown Source:539) at d2.j.d(Unknown Source:106) at b2.k$d.i(Unknown Source:82) at b2.k$d.u(Unknown Source:12) at d2.i.e(Unknown Source:240) at b2.k.i(Unknown Source:80) at b2.x.i(Unknown Source:125) at x2.a.q(Unknown Source:8) at m3.h0.run(Unknown Source:105) at r3.g$a.run(Unknown Source:3) at s3.j.run(Unknown Source:2) at s3.a$a.run(Unknown Source:95) Suppressed: r3.e: [k1{Cancelling}@667b252, Dispatchers.Default]

esosaphilip commented 3 months ago

Hello AzimAnsari, I would liketocontribute to this project if itstill relevant.

cartland commented 2 weeks ago

I think this is fixed. I tried testing after the latest updates in https://github.com/android/kotlin-multiplatform-samples/pull/31.