kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

java.lang.ClassNotFoundException: Didn't find class "kotlinx.serialization.json.Json" on path: DexPathLis

Open msalamaCS opened this issue 1 year ago • 1 comments

When dexguarding the APK and running Kotlin from JSON to data serialization, I'm getting this crash exception: java.lang.ClassNotFoundException: Didn't find class "kotlinx.serialization.json.Json" on path: DexPathList. However, it is working fine in debug mode.

I tried to include all Kotlin serialization classes, but I'm still getting the exception.

`java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/serialization/json/Json;

Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlinx.serialization.json.Json" on path: DexPathList`

Attach a code snippet or test data if possible.

Expected behavior

Environment

  • Kotlin version: 1.8.0
  • Library version: 1.6.3
  • Kotlin platforms:
  • Gradle version: 7.4
  • IDE version (if bug is related to the IDE) [e.g. IntellijIDEA 2019.1, Android Studio 3.4]
  • Other relevant context [e.g. OS version, JRE version, ... ]

msalamaCS avatar May 25 '24 22:05 msalamaCS

Not sure what can be the case, since Json is a regular class and should be processed just as any other usual class. Maybe -keep class kotlinx.serialization.json.** { *; } would help? If possible, please attach your project here or in another github repo because it is hard to say what happened without a reproducer.

sandwwraith avatar May 27 '24 13:05 sandwwraith

No reproducer

sandwwraith avatar Nov 27 '24 16:11 sandwwraith