I am using these dependency on my android build.gradle file implementation group: 'org.apache.poi', name: 'poi', version: '3.17' implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '3.17' implementation group: 'org.apache.poi', name: 'poi-ooxml-schemas', version: '3.17' Unfortunately it throws these error while building ... Android setup compileSdkVersion 26 defaultConfig { applicationId "com.example.test" minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } ERROR : Execution failed for task ':app:transformClassesWithStackFramesFixerForDebug'. > com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.utils.FileCache$FileCreatorException: java.util.zip.ZipException: duplicate entry: org/apache/xmlbeans/xml/stream/Location.class I couldn't resolve this since i am a beginner. Could you help,Please ?
Use https://github.com/pjfanning/xmlbeans instead of Apache XMLBeans. See the sample linked in the README file.
We handle the duplicate classes in XmlBeans in bug #59268, so I am closing this as duplicate. However note that there are a number of additional things that may affect you when using Apache POI on Android. There is a separate project at https://github.com/centic9/poi-on-android/ which tries to provide a way to more easily get most of these fixed. You may want to take a look there and probably use the single jar-file that is provided as part of that project. *** This bug has been marked as a duplicate of bug 59268 ***
Thanks