32

I am getting Unable to execute dex: Java heap space Java heap space error while executing web driver script in Eclipse IDE. I have configured Eclipse IDE with Android SDK and AVD Manager.

I also increased the -Xms200m to -Xmx512m but it did not work.

gprathour
  • 14,813
  • 5
  • 66
  • 90
Atin
  • 380
  • 1
  • 5
  • 10

5 Answers5

34

The accepted solution to this post worked for me: Conversion to Dalvik format failed: Unable to execute dex: Java heap space

The gist is: Keep increasing the Xms and Xmx values until it either works or you run out of physical memory.

E.g.: -XX:MaxPermSize=1536m -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx1536m

Community
  • 1
  • 1
Mike
  • 501
  • 3
  • 8
2

You said

I also increased the -Xms200m to -Xmx512m

-Xms200m and -Xmx512m are two different things. Maybe you wanted to say

from -Xms200m to -Xms512m

and

from -Xmx200m to -Xmx512m

Joand
  • 330
  • 4
  • 13
  • hey this one i am not getting clearly. can u explain briefly. where can i change -Xms512m -Xmx512m. i am getting same error. tell me about this. – Jeeva Jun 05 '12 at 10:14
  • 1
    You can add these options in the file named **eclipse.ini** You can find more informations here http://wiki.eclipse.org/Eclipse.ini – Joand Jun 05 '12 at 15:56
1

Change -Dosgi.requiredJavaVersion=1.5 to

-Dosgi.requiredJavaVersion=1.6

if your eclipse project is using java compiler 1.6. I just solved this problem.

herbertD
  • 10,657
  • 13
  • 50
  • 77
0

Adding this to my build.gradle finally solved it for me

dexOptions {
        preDexLibraries = false
}
user2700475
  • 827
  • 2
  • 7
  • 16
0

When facing this problem I found that my eclipse.ini was renamed to _eclipse.ini, thus Eclipse was not able to find it and took to these misbehaviours.

I renamed it back to eclipse.ini and everything backed to work normally.

Niki Romagnoli
  • 1,406
  • 1
  • 21
  • 26