I'm trying to add spring-context to a project in Android Studio. I have to bring in Xerces so Spring can parse my context file correctly, but that leads to this error:
Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
gradlew assembleDebug
says the problem is:
trouble processing "javax/xml/XMLConstants.class"
and then adds a long, supercilious lecture about why compiling core libraries is a bad thing. Okay, so how do I fix this?
One thing that didn't work was trying to exclude the offending module:
compile ('xerces:xercesImpl:2.11.0') {
exclude module: 'xml-apis'
}
This led to much more extensive compile errors.
Another thing that didn't work was following the instructions for this Gradle JarJar plugin, which led to:
Could not find property 'preBuild' on task set.
I'm about ready to give up and just write my own parser from scratch. Is there a way to make this work?