Pick the fix
A release build crashes parsing JSON with Gson; debug works. Best fix?
Hint 1 of 1
How does Gson find field names?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Add narrow keep rules for the model classes, or move to a reflection-free serializer like kotlinx.serialization
Correct. R8 renamed fields that Gson finds by reflection.
Why not the others?
- B Disable minification. Throws away size and speed gains.
- C Keep every class in the app. Same as turning R8 off.
- D Ship the debug build. Never.