Finding source line on exception (Android, Eclipse) - android

When the Eclipse debugger stops due to an exception in my Android project, I can see the exception message in the variables window (e.g., "null pointer"), but how can I find out what Java code line my app was at when the exception occurred?
I can see a stack trace in the LH window, but selecting any of them doesn't seem to reveal anything that relates to my code.

Look in the LogCat view (in Eclipse Window-->Show View-->Other...-->Android-->LogCat) or in the adb logcat output from a terminal. The place to look will likely be the first mention of one of your classes below the line:
E/AndroidRuntime( ####): Caused by:

Related

Unhandled event loop exception while I try to add a second Activity

I'm new to Android app development. I'm using Eclipse v4.6 (Neon) for this. When I try to add a second Activity to my project, an error occurs which says:
Unhandled event LoopException occurred.
Other details of the error are:
The details of the log file are:
Unhandled event loop exception
java.lang.StackOverflowError
The details of the log file are:
Plug In: org.eclipse.ui
Severity: error
Exception Stack Trace:
java.lang.StackOverflowError
at org.eclipse.core.internal.filesystem.local.LocalFileNatives.internalGetFileInfoW(Native Method)
at org.eclipse.core.internal.filesystem.local.LocalFileNatives.fetchFileInfo(LocalFileNatives.java:113)
at org.eclipse.core.internal.filesystem.local.LocalFileHandler.fetchFileInfo(LocalFileHandler.java:27)
at org.eclipse.core.internal.filesystem.local.LocalFileNativesManager.fetchFileInfo(LocalFileNativesManager.java:62)
at org.eclipse.core.internal.filesystem.local.LocalFile.fetchInfo(LocalFile.java:159)
at org.eclipse.core.filesystem.provider.FileStore.fetchInfo(FileStore.java:258)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.fastIsSynchronized(FileSystemResourceManager.java:463)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.isSynchronized(FileSystemResourceManager.java:735)
at org.eclipse.core.internal.resources.Resource.isSynchronized(Resource.java:1446)
at org.eclipse.core.internal.resources.File.getContentDescription(File.java:257)
How do I fix these errors?
In Android Studio there is a AndroidManifest.xml file which all activities are registered in. Maybe you should register your activities in Eclipse as well.
Try to add an activity with your IDE tools, not by yourself. In Android Studio you can easily right click on the project folder → New → Android activity.
In Eclipse you can click on the new project button and choose Android Activity (below Android Application Project).

How to fix error in android sdk - java.lang.StackOverflowError

Soon as I open eclipse, I get following error on popup:
Unknown exception in parseSdkContent.
java.lang.StackOverflowError
If I close this popup I get another popup saying the following:
A stack overflow error has occurred.
you are recommended to exit the workbench.
subsequent errors may happen and may terminate the workbench without warning.
see the .log file for more details.
So than I checked my .log file and it had a following error:
!ENTRY com.android.ide.eclipse.adt 4 0 2015-05-13 22:56:25.701
!MESSAGE Unknown exception in parseSdkContent.
!STACK 0
java.lang.StackOverflowError
at com.android.ide.eclipse.adt.internal.sdk.ProjectState.buildFullLibraryDependencies(ProjectState.java:682)
at com.android.ide.eclipse.adt.internal.sdk.ProjectState.buildFullLibraryDependencies(ProjectState.java:691)
at com.android.ide.eclipse.adt.internal.sdk.ProjectState.buildFullLibraryDependencies(ProjectState.java:691)
at com.android.ide.eclipse.adt.internal.sdk.ProjectState.buildFullLibraryDependencies(ProjectState.java:691)
at com.android.ide.eclipse.adt.internal.sdk.ProjectState.buildFullLibraryDependencies(ProjectState.java:691)
I already tried the following 5 things:
1) Re-install eclipse and reset my phone
2) Update android SDK Manager
3) Update ADT
4) Delete my .android folder
5) Use 'task manager' to end 'adb'. than I restart my adb using cmd.
But nothing is seem to be working. any ideas?
It is important to trace down memory leaks. We use canaryleaks in order to monitor objects that might cause problems in the future.
Take a look at this post, this might help you.
https://corner.squareup.com/2015/05/leak-canary.html

Graphic is disposed Exception

I am getting the following exception stack trace when I open the ADT/Eclipse:
org.eclipse.swt.SWTException: Graphic is disposed...(remaining trace here is quite long)
The corresponding messages in the Event details dialog are as follows:
Exception while dispatching event org.osgi.service.event.Event
[topic=org/eclipse/e4/ui/model/ui/UIElement/toBeRendered/SET] to
handler
org.eclipse.e4.ui.services.internal.events.UIEventHandler#7f6e8e26
Error while loading editor
Unhandled event loop exception
Just prior to these errors I was copying XML files form one project to another.
I have subsequently deleted every XML that had been copied but still getting the errors.
Am new to the ADT have read around a bit have not found any solutions.
Also, this is the first message to appear when opening ADT:
System property http.nonProxyHosts has been set to
local|.local|169.254/16|.169.254/16 by an external source. This
value will be overwritten using the values from the preferences
Performing a clean and refresh on eclipse (in terminal CD to Eclipse.app\Contents\MacOS then ./eclipse -clean -refresh. ) removed the error temporarily . Once I updated to eclipse Juno the error disappeared altogether. Hope this helps anyone with similar issue.

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.

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)

Categories

Resources