4
我正在開發一個android應用程序。我需要在應用程序中顯示docx,xlsx文件。我在網上搜索過,發現docx4j
會將docx,xlsx文件轉換爲html(或)pdf。因此,我打算在web視圖中顯示docx4j
的html返回。Android - docx4j構建問題
因此,我已經從github下載了源代碼並嘗試運行該示例。我也在鏈接中給出了eclipse.ini文件中的更改。
但是,我無法執行應用程序。當我運行該應用程序時,出現以下異常。
[2014-11-24 17:19:34 - AndroidDocxToHtml-master] Conversion to Dalvik format failed with error 1
詳細日誌:
[2014-11-24 17:19:34 - AndroidDocxToHtml-master] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.xml.serializer.SecuritySupport12$8) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2014-11-24 17:19:34 - AndroidDocxToHtml-master] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: bad utf-8 byte 9a at offset 00000002
at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:374)
at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)
at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:294)
at com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)
at com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)
at com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:665)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:188)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:786)
at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:597)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:328)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:403)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
at org.eclipse.core.internal.resources.Project.build(Project.java:124)
at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1143)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:155)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.IllegalArgumentException: bad utf-8 byte 9a at offset 00000002
at com.android.dx.rop.cst.CstString.throwBadUtf8(CstString.java:171)
at com.android.dx.rop.cst.CstString.utf8BytesToString(CstString.java:143)
at com.android.dx.rop.cst.CstString.<init>(CstString.java:200)
at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)
... 42 more
...while parsing cst 008c at offset 000002a6
...while parsing cst 0005 at offset 00000018
...while parsing org/apache/xml/serializer/utils/SerializerMessages_ru.class
[2014-11-24 17:19:34 - AndroidDocxToHtml-master] Dx 1 error; aborting
[2014-11-24 17:19:34 - AndroidDocxToHtml-master] Conversion to Dalvik format failed with error 1
我已經添加了庫的應用程序只有一次。
可能是什麼問題。任何人都可以幫我解決這個問題嗎?
docx4j:我無法獲取整個文檔內容,如圖像,表格等。只顯示內容,而不是「格式化內容」,並且需要更多時間才能轉換爲html。 – SKK 2014-12-05 11:43:11