Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
msalamaCS opened this issue May 25, 2024 · 1 comment

Comments

@msalamaCS
Copy link

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, ... ]
@sandwwraith
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants