1

When trying to build my android project I get the following error. I've been able to compile without complain on other machines with (what I believe to be) the exact same setup (ubuntu 11.10/eclipse indigo/same android sdk)

Unable to execute dex: java.lang.StackOverflowError. Check the Eclipse log for stack trace.
Conversion to Dalvik format failed: Unable to execute dex: java.lang.StackOverflowError. Check the Eclipse log for stack trace.

In the eclipse log all I get is about 2 pages of :

java.lang.StackOverflowError
at com.android.dx.cf.code.Ropper$2.visitBlock(Ropper.java:1310)
at com.android.dx.cf.code.Ropper.forEachNonSubBlockDepthFirst0(Ropper.java:1647)
at com.android.dx.cf.code.Ropper.forEachNonSubBlockDepthFirst0(Ropper.java:1671)
at com.android.dx.cf.code.Ropper.forEachNonSubBlockDepthFirst0(Ropper.java:1671)
at com.android.dx.cf.code.Ropper.forEachNonSubBlockDepthFirst0(Ropper.java:1671)
...

Any suggestions would be greatly appreciated. :)

Edit: Searching the log files I also found that I got this error right before.

Warning: A handler conflict occurred.  This may disable some commands.
Conflict for 'org.eclipse.ltk.ui.refactor.apply.refactoring.script':
HandlerActivation(commandId=org.eclipse.ltk.ui.refactor.apply.refactoring.script,
    handler=ActionDelegateHandlerProxy(null,org.eclipse.ltk.ui.refactoring.actions.ApplyRefactoringScriptAction),
    expression=AndExpression(ActionSetExpression(org.eclipse.cdt.ui.CodingActionSet,org.eclipse.ui.internal.WorkbenchWindow@9801f4),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@9801f4)),sourcePriority=16640)
HandlerActivation(commandId=org.eclipse.ltk.ui.refactor.apply.refactoring.script,
    handler=ActionDelegateHandlerProxy(null,org.eclipse.jdt.internal.ui.refactoring.actions.ApplyRefactoringScriptAction),
    expression=AndExpression(ActionSetExpression(org.eclipse.jdt.ui.CodingActionSet,org.eclipse.ui.internal.WorkbenchWindow@9801f4),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@9801f4)),sourcePriority=16640)
isep
  • 703
  • 1
  • 9
  • 24
  • i have provided solution for this check this link http://stackoverflow.com/questions/20778767/unable-to-execute-dex-java-nio-bufferoverflowexception-check-the-eclipse-log-f/21137273#21137273 – Muhammad Usman Ghani Mar 25 '14 at 06:37
  • see this link > http://stackoverflow.com/questions/20778767/unable-to-execute-dex-java-nio-bufferoverflowexception-check-the-eclipse-log-f/21137273#21137273 – Muhammad Usman Ghani Apr 11 '14 at 05:16

1 Answers1

2

I had got the same error and was able to solve it... Hope it helps you...

Look in the bin folder of your project directory and you will see .dex files generated.. Delete them and try to run your project again...

user671805
  • 602
  • 1
  • 12
  • 29
  • Before you do this, turn off Automatic building and then clean the build space and delete the *.dex files.. or delete the entire bin dir as it will get regenerated. – apesa Nov 14 '11 at 22:05
  • Just want to mention that I think @apesa refers to the automatic building in the Project option of the menu bar.... So uncheck that and then as he suggests.. – user671805 Nov 14 '11 at 22:20
  • I don't think I have any .dex files generated yet. :\ Tried deleting my bin folder just in case though but same error. – isep Nov 14 '11 at 22:23
  • try to increase your memory size .... Maybe that overflow error is due to that ... – user671805 Nov 14 '11 at 22:36
  • how would I do that for an android app though? Found out how to for a java app(http://stackoverflow.com/questions/2127217/java-stack-overflow-error-how-to-increase-the-stack-size-in-eclipse) but since I'm running it as an android app it won't use those params. – isep Nov 14 '11 at 22:47
  • Have a look here http://stackoverflow.com/questions/3456862/increasing-the-memory-capacity-of-the-android-emulator – user671805 Nov 14 '11 at 23:07
  • I guess the issue is that my apk never actually gets built into a .apk rather than it won't run on an emulator/device. The error seems to happens during the build. – isep Nov 14 '11 at 23:17