1

我正在尝试将 qoppa pdf 阅读器集成到我的 android 应用程序中

我确实喜欢这里的描述: http ://www.qoppa.com/android/pdfsdk/guide/index.html - 将 jar 文件添加到我的项目的类路径中。- 添加资产文件夹。- 添加库文件夹。

当我启动 Eclipse 时,一切正常,我可以在我的工作区中打开项目并继续实施。但是当将 pdf 项目作为新的 Eclipse 实例运行时,我得到了这个错误

    [2012-10-29 22:23:25 - com.test] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(c.b.b.c.b.b.b.b.b.i$1) 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.
[2012-10-29 22:26:21 - Dex Loader] Unable to execute dex: Java heap space
[2012-10-29 22:26:23 - com.test] Conversion to Dalvik format failed: Unable to execute dex: Java heap space

我尝试清理我的项目,但仍然出现错误。

我在网上搜索,所以我发现我必须在 eclipse.ini 文件和运行配置中增加 PermGen 的大小。这是我的 evlipse.ini 经过一些更改后:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
1024M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms256m
-Xmx1024m

没有用,我仍然得到错误。

可能是什么问题呢?

我认为是因为 qoppapdf.jar,jar 的大小很大,超过 4000000 字节。但它应该可以工作,因为有使用这个 jar 的示例,我不知道为什么我的 eclipse 不能这样做

4

3 回答 3

4

尝试以下操作:

-> Right click your project. 
-> Go to Properties 
-> Java Build Path 
-> Order and Export.
-> Uncheck the check box against your included library. 
-> Press OK and run the project.

这样做时,Eclipse 将只从 jar 中获取代码中需要的类,而不是存储 jar 中的所有类。

于 2013-07-18T10:14:06.050 回答
3

您需要为运行配置增加分配的内存,而不是为 eclipse。在 VM 参数字段下添加 -Xms256m 和 -Xms1024m。

在此处输入图像描述

于 2012-10-29T21:05:33.893 回答
1

也将 -Xms256m 更改为 -Xms1024m,它只给它 256 兆,java 应用程序是内存密集型的,需要很多。

于 2012-10-29T21:06:08.027 回答