Bug 61921 - build error while using jar 3.17 version with android
Summary: build error while using jar 3.17 version with android
Status: RESOLVED DUPLICATE of bug 59268
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.17-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 11:46 UTC by Prabin Shrestha
Modified: 2017-12-27 10:30 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prabin Shrestha 2017-12-20 11:46:15 UTC
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 ?
Comment 1 PJ Fanning 2017-12-20 12:40:56 UTC
Use https://github.com/pjfanning/xmlbeans instead of Apache XMLBeans.
See the sample linked in the README file.
Comment 2 Dominik Stadler 2017-12-24 11:41:29 UTC
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 ***
Comment 3 Prabin Shrestha 2017-12-27 10:30:24 UTC
Thanks