Klaxon throws exceptions after minifying (w/ Proguard)
See original GitHub issueWhen Klaxon class names were minified, it could not find the DefaultConverter’s method toJson()
.
After adding the following rules to ProGuard, it throws a different exception:
-keep public class kotlin.reflect.jvm.internal.impl.** { public *; }
-keep class com.beust.klaxon.** { *; }
-keep interface com.beust.klaxon.** { *; }
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bleh.application/com.bleh.application.WhateverActivity}: java.lang.ClassCastException: java.lang.String cannot be cast to com.beust.klaxon.JsonObject
The application works perfectly when I turn minify off. Any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Developers - Klaxon throws exceptions after minifying (w/ Proguard) -
Klaxon throws exceptions after minifying (w/ Proguard) ... When Klaxon class names were minified, it could not find the DefaultConverter's method toJson() ....
Read more >Obfuscating method with throws clause - java - Stack Overflow
I'm using ProGuard to obfuscate my code. My project is comprised of a few modules, each obfuscated independently. ... The library with the...
Read more >Troubleshooting ProGuard issues on Android - Medium
Getting a ClassNotFoundException or MethodNotFoundException at runtime is a sure sign you are missing classes or methods, either because ...
Read more >Wall Avenue Protests, Facebook, Twitter, Lookup, Youtube ...
Wall Street Protests, Facebook, Twitter, Search, Youtube, Videos, Craigslist, Cnn, News, Photos, Pictures, Movies, Moammar Kadafi, Dead, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Tarpsvo try adding
this is what worked with minify for my project:
Note that the error might be coming from a converter outside of the
com.beust.klaxon
package. If you wrote any custom converter, make sure tokeep
these classes too.