I need to exclude a class which is present in a third party library jar file. i don't know the exact syntax format to exclude a group. i tried the following syntax for excluding a class named XMLConstants.class inside the library "javax.xml.stream.jar".
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/xsdlib-1.5.jar')
compile files('libs/relaxngDatatype-2.2.jar')
compile files('libs/javax.xml.stream.jar'){
exclude module: 'javax-xml-stream'
}
compile files('libs/pull-parser-2.jar')
compile files('libs/javax.xml.bind.jar')
compile files('libs/java-rt-jar-stubs-1.5.0.jar')
compile files('libs/jaxen-core.jar')
compile files('libs/jaxen-dom4j.jar')
compile files('libs/jaxen-1.1-beta-2.jar')
}
If i use this syntax i am getting the following error.
Error:(52, 0) Could not find method exclude() for arguments [{module=javax-
xml-stream-XMLConstants}]
I am new to android so i need to know how to write a syntax to exclude a particular class in a third party library jar file. If there is any other method to do this please suggest. Thanks in advance.