Closed mhelder closed 1 month ago
I would like also bump this issue. In our production project we are facing the same problem - for debug build we don't have any problem, app is crashing for release build where isMinifyEnabled is set on true value.
I checked @mhelder sample project, and from our side we have the same configuration of class/project:
generateAdapter
with true
value for sealed class;build
folder for release
version;Maybe are we missed something?
moshi-sealed-codegen
does not seem to work as advertised with minification enabled.Reproducer: https://github.com/mhelder/moshix-sealed-missing-proguard-rules // edit: forgot to push my branch 🤦 - fixed now!
It takes the
Message
sample from the Moshi-sealed docs and does this:Works fine with
isMinifyEnabled = false
. It'll outputSuccess(value=Yay)
on screen.Now flip the
isMinifyEnabled
flag for thedebug
build type or run therelease
.R8 full mode on (default):
R8 full mode off (set
android.enableR8.fullMode=false
ingradle.properties
):Project has no Proguard/R8 rules defined.
Rules generated under
resources/META-INF/proguard
:moshi-com.example.app.data.model.Message.Success.pro:
moshi-com.example.app.data.model.Message.pro: