Duplicate class org.xmlpull.v1.XmlPullParser Android

Viewed 1277

i have a hudge problem while integrating a new library on Android App.

When i tried to implementation 'br.com.stone:stone-sdk:3.8.2' on Gradle (app module) and sync project, android shows a new issue

Duplicate class org.xmlpull.v1.XmlPullParser found in modules jetified-ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar (ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar) and jetified-xpp3_min-1.1.4c.jar (xpp3:xpp3_min:1.1.4c)
Duplicate class org.xmlpull.v1.XmlPullParserException found in modules jetified-ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar (ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar) and jetified-xpp3_min-1.1.4c.jar (xpp3:xpp3_min:1.1.4c)

Perhaps implementation files('libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar') has already the same Class.

Can anynone help me solving this problem?

1 Answers

I'm posting this answer for reference, based on https://github.com/flutter/flutter/issues/59341. All you need to do is to add 3 items in app/build.gradle:

#1

shrinkResources false

minifyEnabled false

#2

configurations { all*.exclude group: 'xpp3', module: 'xpp3' }

#3

implementation 'xmlpull:xmlpull:1.1.3.4d_b4_min'

PS: I used this solution fix a similar issue (just replaced "xpp3" with "xmlpull" in item #2):

Execution failed for task ':app:checkDebugDuplicateClasses'. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class org.xmlpull.v1.XmlPullParser found in modules jetified-kxml2-2.3.0 (net.sf.kxml:kxml2:2.3.0) and jetified-xmlpull-1.1.3.4d_b4_min (xmlpull:xmlpull:1.1.3.4d_b4_min) Duplicate class org.xmlpull.v1.XmlPullParserException found in modules jetified-kxml2-2.3.0 (net.sf.kxml:kxml2:2.3.0) and jetified-xmlpull-1.1.3.4d_b4_min (xmlpull:xmlpull:1.1.3.4d_b4_min)

Related