Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.6
-
Fix Version/s: 1.4.7
-
Component/s: Converters
-
Labels:None
Description
I've been using XStream in my application on Android 4.1.2 (and earlier) without any troubles, but on the Android 4.4.2 it throws following exception:
java.lang.NoSuchMethodError: sun.misc.Unsafe.putBoolean
at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.write(Sun14ReflectionProvider.java:104)
at com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.writeField(Sun14ReflectionProvider.java:78)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:303)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:377)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1157)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1141)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1012)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1003)
I've googled alot trying to find workaround for this problem, but no luck, unfortunately.
Solution was found: all primitive types (int, boolean, float) should be replaced with their object equivalents.