I am using simplexml in my android project, and everything works fine until I obfuscate the code. Then, errors start pouring in.
Part of the XML is as follows:
I kept getting the following errors:
can't find referenced class javax.xml.stream.XMLEventReader
can't find referenced class javax.xml.stream.events.XMLEvent
This is because these are part of the Java runtime (rt.jar) but not part of the Android runtime (android.jar), so ProGuard warns that something might be broken. This isn't actually a problem, so we can do the following:
-dontwarn javax.xml.stream.events.**
Source
Combined with the answer of zmicer, I get the following
-dontwarn javax.xml.stream.events.**
-keep public class org.simpleframework.** { *; }
-keep class org.simpleframework.xml.** { *; }
-keep class org.simpleframework.xml.core.** { *; }
-keep class org.simpleframework.xml.util.** { *; }
-keepattributes ElementList, Root
-keepclassmembers class * {
@org.simpleframework.xml.* *;
}