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).
Related
I'm trying to open settings of the a project that someone left me in the company. When I click on Open Settings the Android Studio IDE fails and show a "null" error.
What I can do?? It says to me to "disabe android support plugin". I'm lost.
null
java.lang.StackOverflowError
at java.lang.Exception.<init>(Exception.java:54)
at java.lang.RuntimeException.<init>(RuntimeException.java:51)
at java.lang.NullPointerException.<init>(NullPointerException.java:60)
at java.lang.String.getBytes(String.java:917)
at com.intellij.openapi.util.io.FileSystemUtil$JnaUnixMediatorImpl$UnixLibC.lstat(Native Method)
at com.intellij.openapi.util.io.FileSystemUtil$JnaUnixMediatorImpl.getAttributes(FileSystemUtil.java:460)
at com.intellij.openapi.util.io.FileSystemUtil.getAttributes(FileSystemUtil.java:116)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.getAttributes(LocalFileSystemBase.java:769)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.isDirectory(LocalFileSystemBase.java:107)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.findChild(VirtualDirectoryImpl.java:102)
at com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl.refreshAndFindChild(VirtualDirectoryImpl.java:284)
at com.intellij.openapi.vfs.newvfs.VfsImplUtil.refreshAndFindFileByPath(VfsImplUtil.java:131)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByPath(LocalFileSystemBase.java:56)
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshAndFindFileByIoFile(LocalFileSystemBase.java:211)
at...
The full stacktrace: Stacktrace Error
So I'm trying out xamarin in VS2017, but found this undhandled error:
Unhandled Exception:
Java.Lang.SecurityException: <Timeout exceeded getting exception details>
This is very clueless. How can I get the full information of the runtime error like in Android Studio?
I had the same problem while calling some native API,
solved it by
Put a try catch around the block of got which is throwing the error.
Put a breakpoint in the catch block, you can get actual details of the exception.
After getting assistance from Microsoft, I finally found the solution.
TL;DR
Use VS Android device log and filter with "mono-rt" or "Error"
Complete Answer:
There are 2 solution:
1. Using Android Studio logcat:
Open the Android Studio logcat (View > Tool Windows > Logcat). From the logcat window, choose the device, choose the Xamarin.Android deployed application, and choose logcat for Error
Android logcat will display the runtime error:
2. Using Visual Studio Android Device Log:
Open the Visual Studio Android Device Log(Tools > Android > Device Log).
Here is the tricky bit: Unlike Android Studio, VS list all of the device log, not limited to the Xamarin.Android app deployed. So somehow we have to use the filter to get the relevant information. The problem is, what filter should we use? I used my application name and the error didn't show up. It turns out that when the error happen, the log doesn't contain any of the application name. Instead it has "mono-rt" tag with "Error" type.
So there you have it. Filter it with "mono-rt" tag or "Error" type and you will find the error information
I just created a new activity called "activity_direction" in my android app,but I discovered an error message in two lines of my new activity. First one is on setContentView(R.layout.activity_direction); of the onCreate() method.The error message says:
"activity_direction cannot be resolved to a type or is not a field".
The second error message is at getMenuInflater().inflate(R.menu.direction, menu); of the onCreateOptionsMenu() method.The error message also says:
"activity_direction cannot be resolved to a type or is not a field".
Select project from menu options in eclipse and click build project.
This issue mey occure when R.java file does could not create id for layout. if problem still remain, just restart your eclipse
Assuming that you have already created activity_direction.xml under res/layout directory and direction.xml under res/menu. Try this.
In Eclipse,
Select Project -> Clean
In Android Studio,
Select Build -> Clean Project
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.
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.