Proguard obfuscation is breaking simplexml

后端 未结 7 781
耶瑟儿~
耶瑟儿~ 2020-12-14 18:01

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:

7条回答
  •  囚心锁ツ
    2020-12-14 18:28

    You already figured out that keeping annotation is a good idea. You may also try to add type parameter to @ElementList annotation - apparently there is a problem with generic type erasure and simplexml needs additional hint about type of elements in the list

    you may also play around with -keepattributes Signature, *Annotation*:

    The "Signature" attribute is required to be able to access generic types when compiling in JDK 5.0 and higher.

提交回复
热议问题