Giter Club home page Giter Club logo

androidreadxlsx's People

Contributors

andruhon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

androidreadxlsx's Issues

java.lang.ClassCastException: org.apache.xmlbeans.impl.values.XmlComplexContentImpl cannot be cast to org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing

When reading excel with images, I get this error.

03-31 16:57:39.119 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:426)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:431)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:221)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at pro.kondratev.xlsxpoiexample.MainActivity.onReadClick(MainActivity.java:42)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.view.View$1.onClick(View.java:3818)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.view.View.performClick(View.java:4438)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.view.View$PerformClick.run(View.java:18422)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.os.Handler.handleCallback(Handler.java:733)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.os.Looper.loop(Looper.java:136)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5001)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at dalvik.system.NativeStart.main(Native Method)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: Caused by: java.lang.reflect.InvocationTargetException
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Constructor.constructNative(Native Method)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: ... 19 more
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: Caused by: java.lang.ClassCastException: org.apache.xmlbeans.impl.values.XmlComplexContentImpl cannot be cast to org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing$Factory.parse(Unknown Source)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: at org.apache.poi.xssf.usermodel.XSSFDrawing.(XSSFDrawing.java:84)
03-31 16:57:39.129 23479-23479/pro.kondratev.xlsxpoiexample W/System.err: ... 22 more

Enabling proguard

Hi.

I'm using your good library for reading xlsx. Thank you.

I'm trying to use proguard.

But Errors occured when i build the app.

Can you let me know how to write proguard rules to build app with your libs?

My proguard rules below : 👍

Optimize
-optimizations !field/,!class/merging/,*
-mergeinterfacesaggressively

Apache POI
-dontwarn org.apache.**
-dontwarn org.openxmlformats.schemas.**
-dontwarn org.etsi.**
-dontwarn org.w3.**
-dontwarn com.microsoft.schemas.**
-dontwarn com.graphbuilder.**
-dontnote org.apache.**
-dontnote org.openxmlformats.schemas.**
-dontnote org.etsi.**
-dontnote org.w3.**
-dontnote com.microsoft.schemas.**
-dontnote com.graphbuilder.**

-keeppackagenames org.apache.poi.ss.formula.function

-keep class com.fasterxml.aalto.stax.InputFactoryImpl
-keep class com.fasterxml.aalto.stax.OutputFactoryImpl
-keep class com.fasterxml.aalto.stax.EventFactoryImpl

-keep class schemaorg_apache_xmlbeans.system.sF1327CCA741569E70F9CA8C9AF9B44B2.TypeSystemHolder { public final static *** typeSystem; }

-keep class org.apache.xmlbeans.impl.schema.BuiltinSchemaTypeSystem { public static *** get(...); public static *** getNoType(...); }
-keep class org.apache.xmlbeans.impl.schema.PathResourceLoader { public (...); }
-keep class org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler { public static *** compile(...); }
-keep class org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl { public (...); public static *** get(...); public static *** getNoType(...); }
-keep class org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl { public static *** getContextTypeLoader(...); public static *** build(...); }
-keep class org.apache.xmlbeans.impl.store.Locale { public static *** streamToNode(...); public static *** nodeTo*(...); }
-keep class org.apache.xmlbeans.impl.store.Path { public static *** compilePath(...); }
-keep class org.apache.xmlbeans.impl.store.Query { public static *** compileQuery(...); }

-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTAuthors { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorders { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellAlignment { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellStyleXfs { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellXfs { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCol { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCommentList { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDrawing { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFills { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFonts { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontName { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLegacyDrawing { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTNumFmts { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageMargins { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPane { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSelection { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetData { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetDimension { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetFormatPr { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetView { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetViews { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheets { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSst { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.SstDocument { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.StyleSheetDocument { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType$Enum { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType$Enum { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.STXstring { *; }

-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CommentsDocumentImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTAuthorsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBooleanPropertyImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBookViewImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBookViewsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBorderImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBordersImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTBorderPrImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellAlignmentImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellFormulaImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellStyleXfsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCellXfsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTColorImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTColImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTColsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCommentImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCommentsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTCommentListImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTDrawingImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFillImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFillsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontNameImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontSchemeImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontSizeImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTIntPropertyImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTLegacyDrawingImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTNumFmtsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTPatternFillImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTPageMarginsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTPaneImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTRowImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSelectionImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetDataImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetDimensionImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetFormatPrImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetViewImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetViewsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetsImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSstImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTStylesheetImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTRstImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTWorkbookImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTWorkbookPrImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTWorksheetImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTXfImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.SstDocumentImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.StyleSheetDocumentImpl { *; }
-keep class org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.STXstringImpl { *; }

-keep class org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl.CTPropertiesImpl { *; }
-keep class org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl.PropertiesDocumentImpl { *; }
-keep class org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl.CTPropertiesImpl { *; }
-keep class org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl.PropertiesDocumentImpl { *; }
-keep class org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl.CTDrawingImpl { *; }
-keep class org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl.CTMarkerImpl { *; }
-keep class com.microsoft.schemas.office.office.impl.CTIdMapImpl { *; }
-keep class com.microsoft.schemas.office.office.impl.CTShapeLayoutImpl { *; }
-keep class com.microsoft.schemas.vml.impl.CTShadowImpl { *; }
-keep class com.microsoft.schemas.vml.impl.CTFillImpl { *; }
-keep class com.microsoft.schemas.vml.impl.CTPathImpl { *; }
-keep class com.microsoft.schemas.vml.impl.CTShapeImpl { *; }
-keep class com.microsoft.schemas.vml.impl.CTShapetypeImpl { ; }
-keep class com.microsoft.schemas.vml.impl.CTStrokeImpl { ; }
-keep class com.microsoft.schemas.vml.impl.CTTextboxImpl { ; }
-keep class com.microsoft.schemas.office.excel.impl.CTClientDataImpl { ; }
-keep class com.microsoft.schemas.office.excel.impl.STTrueFalseBlankImpl { ; }
-keep class org.apache.poi. { ; }
-keep class org.apache.xmlbeans. { ; }
-keep class org.apache.commons.collections4. { ; }
-keep class org.openxmlformats.schemas. { *; }

java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536

Hi,

I use aa-poi-3.10-min-0.1.5.jar & aa-poi-ooxml-schemas-3.10-reduced-more-0.1.5.jar on my lib project
already try using poi-ooxml-schemas-3.10-reduced-less.jar still error

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:501)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:282)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:490)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 2

my build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "19.1.0"

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/ASL2.0'
    }
    compileOptions {
        //sourceCompatibility JavaVersion.VERSION_1_6
        //targetCompatibility JavaVersion.VERSION_1_6
    }
    defaultConfig {
        applicationId "com.crosstechno.xxxxxx"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        //multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            //shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        /*debug {
            //minifyEnabled true
            //shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }*/
    }
}

dependencies {
    compile 'com.android.support:multidex:1.0.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile project(':aFileDialog')
    compile files('libs/aa-poi-3.10-min-0.1.5.jar')
    compile files('libs/aa-poi-ooxml-schemas-3.10-reduced-more-0.1.5.jar')
    //compile files('libs/poi-ooxml-schemas-3.10-reduced-less.jar')
}

what must i do?
thx before :)

Exception is raised in jar file

(I am Using Android Studion )I have added the jar file in libs folder and added them as a library when i open a workbook (Excel File) i am getting the Following Exception @andruhon

java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder. Make sure the generated binary files are on the classpath.

Issue with pictures and drawings

Hi,

I'm using your library on a Android 4.0.3 device and I have to read a template file and rewrite it with some data in it (text) on the external storage of the device.

The read / modify / write of a normal xlsx file works fine, but I need to have some macros, pictures and drawings (buttons) in my template file (it's now a xlsm file). And then, it' getting worst... Macros are well transcripted, but I'm getting errors with pictures and drawings.

Here's the Exception with a button in the file:

org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
04-10 23:57:00.958 23998-23998/com.vetropack W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
04-10 23:57:00.958 23998-23998/com.vetropack W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:426)
04-10 23:57:00.958 23998-23998/com.vetropack W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:431)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:221)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.vetropack.SessionDAO.ajoutFichier(SessionDAO.java:51)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.vetropack.ViewControle.creationFichier(ViewControle.java:232)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.vetropack.ViewControle$3$1.onClick(ViewControle.java:164)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at android.os.Looper.loop(Looper.java:137)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at android.app.ActivityThread.main(ActivityThread.java:4424)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at java.lang.reflect.Method.invoke(Method.java:511)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-10 23:57:00.966 23998-23998/com.vetropack W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at dalvik.system.NativeStart.main(Native Method)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: Caused by: java.lang.reflect.InvocationTargetException
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at java.lang.reflect.Constructor.constructNative(Native Method)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: ... 16 more
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: Caused by: java.lang.NoClassDefFoundError: schemasMicrosoftComOfficeOffice.CTShapeLayout$Factory
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at org.apache.poi.xssf.usermodel.XSSFVMLDrawing.read(XSSFVMLDrawing.java:117)
04-10 23:57:00.974 23998-23998/com.vetropack W/System.err: at org.apache.poi.xssf.usermodel.XSSFVMLDrawing.(XSSFVMLDrawing.java:102)
04-10 23:57:00.981 23998-23998/com.vetropack W/System.err: ... 19 more

I checked, the CTShapeLayout$Factory seems to be in the ooxml jar like it should. Do you have any idea how to get it work ?

See attached the java file who creates the file (it's based on your example file), my gradle.build and the template.xlsm I need to copy. (I had to change rename files to .txt to upload them, just rename them back to have the original files).

Thanks in advance for your feedback.

build.gradle.txt
SessionDAO.java.txt
template.xlsm.txt

[Could not find method] org.apache.xmlbeans.impl.values.TypeStore.add_element_user

Hi ! I hope u've could help me , sorry for my bad english btw i'll try to do my best to explain to you my problem. I've create a new project with POI library , I use your library its allow me to dont have over +65K methods. So my problem is Eclipse look's like he doesn't found the method or library I need.

There is my LogCat :

8009b1e651a195578d75d8c0fe7079e8

If you need more informations about coding i've done or logs ..
I'll respond as soon as possible . Thank you

NoClassDefError while running the application on v4.4

Hi @andruhon

Can you please tell why this particular error is coming while making the application to write .xlsx file in the application. It is throwing Caused by: java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook. when I browsed through the jar files it was there in the package.

PS: The error is coming for version 4.4 and below. It is working fine in android 5.0 and above.

Please find the stacktrace attached below: -

07-03 13:25:08.571 5190-6608/com.vel.barcodetosheet E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:278) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) at java.util.concurrent.FutureTask.setException(FutureTask.java:124) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) Caused by: java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook at com.vel.barcodetosheet.classes.CommonMethods.createDataToExportXLSX(CommonMethods.java:727) at com.vel.barcodetosheet.classes.CommonMethods.exportXLSXFile(CommonMethods.java:677) at com.vel.barcodetosheet.fragments.StandardPlusFragment$ExportListXLSX.doInBackground(StandardPlusFragment.java:971) at com.vel.barcodetosheet.fragments.StandardPlusFragment$ExportListXLSX.doInBackground(StandardPlusFragment.java:955) at android.os.AsyncTask$2.call(AsyncTask.java:264) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137)  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)  at java.lang.Thread.run(Thread.java:856)  Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) at java.lang.ClassLoader.loadClass(ClassLoader.java:501) at java.lang.ClassLoader.loadClass(ClassLoader.java:461) at com.vel.barcodetosheet.classes.CommonMethods.createDataToExportXLSX(CommonMethods.java:727)  at com.vel.barcodetosheet.classes.CommonMethods.exportXLSXFile(CommonMethods.java:677)  at com.vel.barcodetosheet.fragments.StandardPlusFragment$ExportListXLSX.doInBackground(StandardPlusFragment.java:971)  at com.vel.barcodetosheet.fragments.StandardPlusFragment$ExportListXLSX.doInBackground(StandardPlusFragment.java:955)  at android.os.AsyncTask$2.call(AsyncTask.java:264)  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)  at java.util.concurrent.FutureTask.run(FutureTask.java:137)  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)  at java.lang.Thread.run(Thread.java:856) 

issue by adding jar files

After including the two jar files:-
aa-poi-3.10-min-0.1.5.jar
aa-poi-ooxml-schemas-3.10-reduced-more-0.1.5.jar

I am getting the below error in Android:-
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:426)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:221)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at com.exceltopdf.MainActivity.onReadClick(MainActivity.java:51)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at com.exceltopdf.MainActivity.onCreate(MainActivity.java:40)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.Activity.performCreate(Activity.java:5058)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.ActivityThread.access$700(ActivityThread.java:141)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.os.Looper.loop(Looper.java:137)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5059)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at java.lang.reflect.Method.invoke(Method.java:511)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at dalvik.system.NativeStart.main(Native Method)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: Caused by: java.lang.reflect.InvocationTargetException
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at java.lang.reflect.Constructor.constructNative(Native Method)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: ... 19 more
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: Caused by: java.lang.NoClassDefFoundError: org.openxmlformats.schemas.spreadsheetml.x2006.main.StyleSheetDocument$Factory
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.xssf.model.StylesTable.readFrom(StylesTable.java:110)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: at org.apache.poi.xssf.model.StylesTable.(StylesTable.java:81)
04-05 15:23:38.663 7046-7046/com.exceltopdf W/System.err: ... 22 more

Can I have new packed jar files of version poi_3.15

java.lang.reflect.InvocationTargetException

I can run your example successfully, but when i build a demo like your example,it throws exceptions.

this is my module build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.best.dianjia.poitest"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:multidex:1.0.0'
}

and this is the exceptions:

org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
05-18 07:53:26.730 13068-13068/? W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
05-18 07:53:26.730 13068-13068/? W/System.err: at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:426)
05-18 07:53:26.730 13068-13068/? W/System.err: at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
05-18 07:53:26.730 13068-13068/? W/System.err: at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:221)
05-18 07:53:26.740 13068-13068/? W/System.err: at com.best.dianjia.poitest.MainActivity.readExcel(MainActivity.java:41)
05-18 07:53:26.740 13068-13068/? W/System.err: at com.best.dianjia.poitest.MainActivity.access$000(MainActivity.java:20)
05-18 07:53:26.740 13068-13074/? D/dalvikvm: Debugger has detached; object registry had 4768 entries
05-18 07:53:26.740 13068-13068/? W/System.err: at com.best.dianjia.poitest.MainActivity$1.onClick(MainActivity.java:32)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.view.View.performClick(View.java:4424)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.view.View$PerformClick.run(View.java:18383)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.os.Handler.handleCallback(Handler.java:733)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.os.Looper.loop(Looper.java:137)
05-18 07:53:26.740 13068-13068/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:4998)
05-18 07:53:26.740 13068-13068/? W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
05-18 07:53:26.740 13068-13068/? W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
05-18 07:53:26.740 13068-13068/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:811)
05-18 07:53:26.740 13068-13068/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:627)
05-18 07:53:26.740 13068-13068/? W/System.err: at dalvik.system.NativeStart.main(Native Method)
05-18 07:53:26.740 13068-13068/? W/System.err: Caused by: java.lang.reflect.InvocationTargetException
05-18 07:53:26.740 13068-13068/? W/System.err: at java.lang.reflect.Constructor.constructNative(Native Method)
05-18 07:53:26.740 13068-13068/? W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
05-18 07:53:26.740 13068-13068/? W/System.err: at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
05-18 07:53:26.740 13068-13068/? W/System.err: ... 17 more
05-18 07:53:26.740 13068-13068/? W/System.err: Caused by: java.lang.NoClassDefFoundError: org/openxmlformats/schemas/drawingml/x2006/main/ThemeDocument
05-18 07:53:26.740 13068-13068/? W/System.err: at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown Source)
05-18 07:53:26.740 13068-13068/? W/System.err: at org.apache.poi.xssf.model.ThemesTable.(ThemesTable.java:44)
05-18 07:53:26.740 13068-13068/? W/System.err: ... 20 more`

i don't know what i missed. hope you can help me.

Error while generating .xlsx file

@andruhon
AndroidRuntime: FATAL EXCEPTION: main
org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62) on low API devices

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.