Included projects that bring their own xmlpullparser
always needed some extra care in Android Studio since Android brings its own xmlpullparser.
E.g. t
Finally I found the fix. However, I am still puzzled why it depended on the Gradle Plugin Version.
I am using logback-android that somehow depends on xpp3 as you can see on the dependency graph:
+--- com.github.tony19:logback-android-classic:1.1.1-6
| | +--- com.github.tony19:logback-android-core:1.1.1-6
| | \--- com.github.tony19:apktool-lib:1.4.4-3
| | \--- com.google.android:android:2.1_r1
| | +--- commons-logging:commons-logging:1.1.1
| | +--- org.apache.httpcomponents:httpclient:4.0.1
| | | +--- org.apache.httpcomponents:httpcore:4.0.1
| | | +--- commons-logging:commons-logging:1.1.1
| | | \--- commons-codec:commons-codec:1.3
| | +--- org.khronos:opengl-api:gl1.1-android-2.1_r1
| | +--- xerces:xmlParserAPIs:2.6.2
| | \--- xpp3:xpp3:1.1.4c
It must be said that I declared logback-android in a utils module which I then included into my app using implementation project(:'myUtilsModule')
Now I excluded the group xpp3
with its module xpp3
. The group and module names xmlpull
wouldn't work.:
// https://mvnrepository.com/artifact/com.github.tony19/logback-android-classic
implementation('com.github.tony19:logback-android-classic:1.1.1-6') {
exclude group: 'xpp3', module: 'xpp3' //in order to avoid "Multiple dex files define Lorg/xmlpull/v1/XmlPullParser;"
//exclude group: 'xmlpull', module: 'xmlpull' //This works usually on other libs to exclude xmlpull, but not on that one
}
I learnt the hard way how to read the dependency graph and how to exclude items from the graph ;)
::
exclude group: '', module: ''
or just exclude module: ''
Update: With logback-android-1.1.1-7+ the exclude is no longer necessary.