Skip to content Skip to sidebar Skip to footer

Can't Add Xstream File Dependency To Android Studio Project

I have downloaded and added xstream-1.4.8.jar to my Android Studio project. When I build the project it works fine but when I try to run it I get the following error from the Gradl

Solution 1:

XStream 1.4.8 is compiled for Java 8 and the latest version Android supports is Java 7.

One solution is to use XStream 1.4.7, that works with Android, and another to download XStream 1.4.8 sources and compile them yourself. In that case you will have to remove LambdaMapper.java and possibly some other problematic classes.

Also you can have issues with different versions of xmlpull parser used. In that case you can exclude one from compiling.

compile('com.thoughtworks.xstream:xstream:1.4.7') {
    exclude group: 'xmlpull', module: 'xmlpull'
}

Post a Comment for "Can't Add Xstream File Dependency To Android Studio Project"