Eclipse: Unable to execute dex: stackOverflowError - android

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)

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

Related

D8 desugaring: Unexpected type adjustment

I enable the new D8 desuaring in Android Studio 3.1.3 in my gradle.properties:
android.enableD8.desugaring=true
Now the compilation fails with this error in one of the java-only modules:
com.android.tools.r8.errors.Unreachable:
Unexpected type adjustment from java.lang.String[] to java.lang.Object[]
Here is the full stack-trace
Note: the old dexer works fine (when I deactivate the option above)
I've checked the java-module and I cannot even find String[] or Object[] in any of the java-files. Adding --debug --scan also didn't give me any more insights in what the problem could be.
Any ideas what the problem can be or how I can get more detailed error info from the dexer: e.g. in which file the erroneous code is?
Although the reason could be any depends on project I want to share the way I have fixed such error:
rename failing jar to zip
run D8 directly on it, something like
D:\Development\Tools\android-sdk\build-tools\28.0.2\d8.bat D:\Development\<PROJECT_PATH>\build\intermediates\intermediate-jars\debug\classes.jar.zip
remove classes one by one from zip and go back step 2 until exception is gone
To speed up the process I was removing files in bulk to narrow down to the package and then to the exact file causing D8 failure.
As it turned out it was the following code (I'm using com.annimon.stream.Stream):
Stream.of(SOME_MAP).map(Map.Entry::getValue).findFirst().orElse(null);
where SOME_MAP is HashMap<String, String[]> and workaround was to use
Stream.of(SOME_MAP).map(entry -> entry.getValue()).findFirst().orElse(null);

Running Android Lint has encountered a... Failed. java.lang.NullPointerException

I just added Google Play Service Library to my project and when I am making a modification in one of my project files I am keep getting an error dialog from eclipse:
'Running Android Lint' has encountered a problem. Failed.
So, I enabled Error Log (Window -> Show View -> Error Log) tab and I found a warning and an error line:
Error:
Failed: com.android.ide.eclipse.adt
java.lang.NullPointerException
at com.android.tools.lint.checks.ApiDetector$ApiVisitor.checkField(ApiDetector.java:1416)
at com.android.tools.lint.checks.ApiDetector$ApiVisitor.visitSelect(ApiDetector.java:1277)
at com.android.tools.lint.client.api.JavaVisitor$DispatchVisitor.visitSelect(JavaVisitor.java:904)
at com.android.tools.lint.client.api.JavaVisitor$DelegatingJavaVisitor.visitSelect(JavaVisitor.java:1147)
at lombok.ast.Select.accept(Select.java:91)
at lombok.ast.MethodInvocation.accept(MethodInvocation.java:121)
at lombok.ast.ExpressionStatement.accept(ExpressionStatement.java:63)
at lombok.ast.Block.accept(Block.java:106)
at lombok.ast.MethodDeclaration.accept(MethodDeclaration.java:240)
at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
at lombok.ast.CompilationUnit.accept(CompilationUnit.java:83)
at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:219)
at com.android.tools.lint.client.api.LintDriver.checkIndividualJavaFiles(LintDriver.java:1624)
at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:993)
at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:869)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:442)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:363)
at com.android.ide.eclipse.adt.internal.lint.LintJob.run(LintJob.java:163)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
and a Warning:
Fatal Error: No API database found at null
An exception stack trace is not available.
My application is working, but it is annoying to close the dialog each time I make an edit and save.
This is a workaround (not exactly the solution). In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors".
EDIT:
Please use the above steps only if you don't care about linting your code. These steps are for turning off Lint checking, not correcting the reported lint errors.
I would suggest for you to check on the warnings on your project. Resolving them one by one may get rid of the startup error.

fatal error: pocketsphinx.h: No such file or directory - following opiatefuchs tutorial

I wanted to try out PocketSphinxAndroidDemo. I thought I meticulously followed the tutorial on how to get it running here: https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo
But I must be missing something. I get the following error when I do a run as as an android application from eclipse:
jni/pocketsphinx_wrap.c:760:26: fatal error: pocketsphinx.h: No such file or directory
compilation terminated.
make: * [obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.c] Error 1
I'm leaning towards maybe I did the ndk-build wrong - but it all seemed to work properly in the cygwin terminal.
I'm hoping someone can point me in the right direction. Thanks.
I've reviewed this previous post and it does not seem to contain an answer for me:
http://sourceforge.net/p/cmusphinx/discussion/help/thread/8369b305/

traceview command run issue

I am trying to use traceview to run some profiling against an Android application. I have wrapped the code that I want to trace with the following lines:
Debug.startMethodTracing("xxx");
// code
Debug.stopMethodTracing();
It successfully generated a trace file, that I pulled from sdcard using the following command line:
$./traceview ~/code/packages/performance_trance.trace
Exception in thread "main" java.lang.NoSuchMethodError: java.util.Arrays.copyOf([II)[I
at com.android.traceview.ProfileProvider.getColumnWidths(ProfileProvider.java:143)
at com.android.traceview.ProfileView.<init>(ProfileView.java:85)
at com.android.traceview.MainWindow.createContents(MainWindow.java:109)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.window.Window.open(Window.java:790)
at com.android.traceview.MainWindow.run(MainWindow.java:65)
at com.android.traceview.MainWindow.main(MainWindow.java:269)
I cannot understand this error message and I didn't find anything useful on Google.
Any help would be much appreciated.
Thanks!
try to open the file with your eclipse (with adt plugin)

Automatically getting error in project when I open it in eclipse

I'm getting an error everytime i try to open a project that doesn't have any.
I get these error messages in the console section of eclipse:
[2011-07-21 19:17:54 - Dex Loader] Unable to execute dex: wrapper was not properly loaded first
[2011-07-21 19:17:54 - Sound Board Template] Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first
Any ideas?
Have you tried re-installing the android SDK?

Categories

Resources