1

I am trying to integrate qoppa pdf reader to my android application

I did like it was described here: http://www.qoppa.com/android/pdfsdk/guide/index.html - add jar file into classpath of my project. - add assets folder. - add libs folder.

When I start Eclipse, everything works fine, I can open the projects in my workspace and continue implementing. But when running the pdf project as a new Eclipse instance, i get this error

    [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

I tryed clean my project, but still getting the error.

I searched in the net, so i found that I have to increased the PermGen size in the eclipse.ini file and in the Run Configuration. Here are my evlipse.ini after some changes:

-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

No use, I still get the error.

What could be the problem?

i Think it is because of qoppapdf.jar, the size of the jar is huge, more than 4000000 bytes. But it is supposed to work because there are samples using this jar, i don't know why my eclipse can't do it

haythem souissi
  • 3,263
  • 7
  • 50
  • 77

3 Answers3

4

Try the following:

-> 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.

On doing this Eclipse will take only the classes which are needed in the code, from the jar instead of storing all the classes from the jar.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Mihir Shah
  • 996
  • 10
  • 19
3

You need to increase the allocated memory for your running configuration, not for eclipse. Add the -Xms256m and -Xms1024m under VM arguments field.

enter image description here

dan
  • 13,132
  • 3
  • 38
  • 49
  • how did you get this view, in my eclipse when i choose "run configuration", i only get thre tabs (android, target, common). There are no arguments – haythem souissi Oct 29 '12 at 21:17
  • @haythemsouissi I'm sorry, this was a 'Run configuration' editor for a plain java project not an android one :(. – dan Oct 29 '12 at 21:21
  • @haythemsouissi See this link for details on how to increase the eclipse memory: http://stackoverflow.com/questions/5943712/conversion-to-dalvik-format-failed-unable-to-execute-dex-java-heap-space Your question is a duplicate of that one. – dan Oct 29 '12 at 21:25
1

change the -Xms256m to -Xms1024m as well, its only giving it 256 megs, java apps are memory intensive and need a lot.

Patrick Evans
  • 41,991
  • 6
  • 74
  • 87