Excel jar poi 3.13 HTC没有读取文件

时间:2016-04-22 11:12:31

标签: android apache-poi

output

我想在地图中阅读excel文件,以便在三星j5设备中加载区域完美无误地运行 当我开始使用HTC 516作为模拟器(真实设备)然后POI-3.13-Library开始抛出此错误我可能无法修复错误我的excel文件很简单有两列请建议我更好的问题解决方案

04-22 16:07:58.280 5264-5264/kyp.E/dalvikvm: Could not find class 'org.apache.poi.hpsf.MutablePropertySet', referenced from method org.apache.poi.POIDocument.writePropertySet
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY: unable to resolve new-instance 8728 (Lorg/apache/poi/hpsf/MutablePropertySet;) in Lorg/apache/poi/POIDocument;
04-22 16:07:58.280 5264-5264/kyp.D/dalvikvm: VFY: replacing opcode 0x22 at 0x0000
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY: unable to resolve exception class 8737 (Lorg/apache/poi/hpsf/WritingNotSupportedException;)
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY: unable to find exception handler at addr 0x44
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY:  rejected Lorg/apache/poi/POIDocument;.writePropertySet (Ljava/lang/String;Lorg/apache/poi/hpsf/PropertySet;Lorg/apache/poi/poifs/filesystem/NPOIFSFileSystem;)V
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY:  rejecting opcode 0x0d at 0x0044
04-22 16:07:58.280 5264-5264/kyp.W/dalvikvm: VFY:  rejected Lorg/apache/poi/POIDocument;.writePropertySet (Ljava/lang/String;Lorg/apache/poi/hpsf/PropertySet;Lorg/apache/poi/poifs/filesystem/NPOIFSFileSystem;)V
04-22 16:07:58.290 5264-5264/kyp.W/dalvikvm: Verifier rejected class Lorg/apache/poi/POIDocument;
04-22 16:07:58.290 5264-5264/kyp.D/AndroidRuntime: Shutting down VM
04-22 16:07:58.290 5264-5264/kyp.W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x420048b0)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime: FATAL EXCEPTION: main
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime: java.lang.VerifyError: org/apache/poi/POIDocument
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at kyp..MapsActivity.readexcel(MapsActivity.java:788)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at kyp..MapsActivity.onCreate(MapsActivity.java:110)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:5133)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2178)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.ActivityThread.access$600(ActivityThread.java:144)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
04-22 16:07:58.290 5264-5264/kyp. E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:137)
04-22 16:07:58.290 5264-5264/kyp. E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5136)
04-22 16:07:58.290 5264-5264/kyp. E/AndroidRuntime:     at java.lang.reflect.Method.invokeNative(Native Method)
04-22 16:07:58.290 5264-5264/kyp.app E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:525)
04-22 16:07:58.290 5264-5264/kyp.app E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
04-22 16:07:58.290 5264-5264/kyp. E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-22 16:07:58.290 5264-5264/kyp.E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
04-22 16:08:00.310 5264-5354/kyp.D/dalvikvm: GC_FOR_ALLOC freed 569K, 13% free 4757K/5456K, paused 17ms, total 17ms

1 个答案:

答案 0 :(得分:1)

It is likely related to the version of Android, there were major changes in 5.x.

If you are going to use 5.x then take a look at https://github.com/andruhon/android5xlsx了解在Android上完全使用POI的方法。

如果您需要Android 4.x支持,请参阅https://github.com/andruhon/AndroidReadXLSX

此外,https://github.com/centic9/poi-on-android/还有另一种方法的早期版本,它允许为Apache POI构建一个具有所有必需依赖项的jar。由于jar文件的大小,这个可能还需要Android 5.x或更新版本。