the_prole the_prole - 1 month ago 14
Android Question

How to add `Simple Framework` to gradle dependencies

I'm trying to use Simple Framework in my project. Here is the dependency in XML format.

<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.7.1</version>
</dependency>


I've tried converting the dependency to Gradle acceptable format.

compile 'simpleframework:simple-xml:2.7.1'


But, I don't think it's correct. What is the correct gradle dependecy?

Answer

The correct Gradle dependency is:

compile 'org.simpleframework:simple-xml:2.7.1'

For Android, you also have to exclude dependencies as they are already in the Android SDK

compile ('org.simpleframework:simple-xml:2.7.1') {
    exclude module: 'stax-api'
    exclude module: 'stax'
    exclude module: 'xpp3'
}
Comments