关于利用POI在Android 上直接编辑word模板出错问题。

从零单排 学生  2017-11-23 08:04:55
想做一个在安卓上输入内容,直接生成相应模板的word文档。在利用POI时出现错误,avd可以跑,但一装到手机就出问题。报错新
11-23 19:59:25.593 25376-25376/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.hcr.health.trywit, PID: 25376
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/collections4/bidimap/TreeBidiMap;
at org.apache.poi.hpsf.Section.<init>(Section.java:178)
at org.apache.poi.hpsf.MutableSection.<init>(MutableSection.java:41)
at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:494)
at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:196)
at org.apache.poi.hpsf.MutablePropertySet.<init>(MutablePropertySet.java:44)
at org.apache.poi.hpsf.SpecialPropertySet.<init>(SpecialPropertySet.java:47)
at org.apache.poi.hpsf.DocumentSummaryInformation.<init>(DocumentSummaryInformation.java:99)
at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java:116)
at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:236)
at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:197)
at org.apache.poi.POIDocument.readPropertySet(POIDocument.java:175)
at org.apache.poi.POIDocument.readProperties(POIDocument.java:158)
at org.apache.poi.hwpf.HWPFDocumentCore.updateEncryptionInfo(HWPFDocumentCore.java:282)
at org.apache.poi.hwpf.HWPFDocument.write(HWPFDocument.java:644)
at org.apache.poi.hwpf.HWPFDocument.write(HWPFDocument.java:619)
at com.hcr.health.trywit.Ass.writeDoc(Ass.java:108)
at com.hcr.health.trywit.Ass.printer(Ass.java:87)
at com.hcr.health.trywit.Ass.onCreate(Ass.java:28)
at android.app.Activity.performCreate(Activity.java:6684)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2652)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2766)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1507)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6236)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.collections4.bidimap.TreeBidiMap" on path: DexPathList[[zip file "/data/app/com.hcr.health.trywit-2/base.apk"],nativeLibraryDirectories=[/data/app/com.hcr.health.trywit-2/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.apache.poi.hpsf.Section.<init>(Section.java:178) 
at org.apache.poi.hpsf.MutableSection.<init>(MutableSection.java:41) 
at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:494) 
at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:196) 
at org.apache.poi.hpsf.MutablePropertySet.<init>(MutablePropertySet.java:44) 
at org.apache.poi.hpsf.SpecialPropertySet.<init>(SpecialPropertySet.java:47) 
at org.apache.poi.hpsf.DocumentSummaryInformation.<init>(DocumentSummaryInformation.java:99) 
at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java:116) 
at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:236) 
at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:197) 
at org.apache.poi.POIDocument.readPropertySet(POIDocument.java:175) 
at org.apache.poi.POIDocument.readProperties(POIDocument.java:158) 
at org.apache.poi.hwpf.HWPFDocumentCore.updateEncryptionInfo(HWPFDocumentCore.java:282) 
at org.apache.poi.hwpf.HWPFDocument.write(HWPFDocument.java:644) 
at org.apache.poi.hwpf.HWPFDocument.write(HWPFDocument.java:619) 
at com.hcr.health.trywit.Ass.writeDoc(Ass.java:108) 
at com.hcr.health.trywit.Ass.printer(Ass.java:87) 
at com.hcr.health.trywit.Ass.onCreate(Ass.java:28) 
at android.app.Activity.performCreate(Activity.java:6684) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2652) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2766) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1507) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6236) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781) 



请教一下各位!
...全文
335 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
romanticaccount 2018-04-24
不建议使用POI,很多java上关于图像的包,andriod是没有的。 可以用libreoffice, android 开源版。
  • 打赏
  • 举报
回复
相关推荐
发帖
Android
加入

7.9w+

社区成员

移动平台 Android
申请成为版主
帖子事件
创建了帖子
2017-11-23 08:04
社区公告
暂无公告