When I build the project I receive following error message :
:app:kaptDebugKotlin
java.lang.reflect.InvocationTargetException (no error message)
There is no more information from Android Studio, and I can not figure out the issue. I appreciate any suggestion.
I found the solution, You can see the actual details after clicking on the above line in the Build Output section of the build tab. You will see more details when you will click on the highlighted part drawn by pen.
The line above where IDE is pointing in the left build output section
Related
I'm currently creating an application with Android Studio and Kotlin.
This morning, when I tried to run the app on the emulator and my phone, I got an error but what I don't understand it's I barely change the code : I just added a textview (tried to delete it but I still got the error. I tried to investigate and do think but none of them worked. I still don't really understand the error, could you help me fix it ?
Here the error :
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Caused by: com.android.aaptcompiler.ResourceCompilationException: Resource compilation failed. Check logs for details.
at com.android.aaptcompiler.ResourceCompiler.compileResource(ResourceCompiler.kt:126)
at com.android.build.gradle.internal.res.ResourceCompilerRunnable$Companion.compileSingleResource(ResourceCompilerRunnable.kt:34)
at com.android.build.gradle.internal.res.ResourceCompilerRunnable.run(ResourceCompilerRunnable.kt:15)
at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
... 3 more
Caused by: java.lang.NullPointerException
at com.android.aaptcompiler.TableExtractor.flattenXmlSubTree(TableExtractor.kt:851)
at com.android.aaptcompiler.TableExtractor.parseXml(TableExtractor.kt:516)
at com.android.aaptcompiler.TableExtractor.parseArrayImpl(TableExtractor.kt:1300)
at com.android.aaptcompiler.TableExtractor.parseStringArray(TableExtractor.kt:1243)
at com.android.aaptcompiler.TableExtractor.access$parseStringArray(TableExtractor.kt:146)
at com.android.aaptcompiler.TableExtractor$extractResource$parseBagMethod$13.invoke(TableExtractor.kt:437)
at com.android.aaptcompiler.TableExtractor$extractResource$parseBagMethod$13.invoke(TableExtractor.kt:437)
at com.android.aaptcompiler.TableExtractor.extractResource(TableExtractor.kt:458)
at com.android.aaptcompiler.TableExtractor.extractResourceValues(TableExtractor.kt:267)
at com.android.aaptcompiler.TableExtractor.extract(TableExtractor.kt:182)
at com.android.aaptcompiler.ResourceCompiler.compileTable(ResourceCompiler.kt:186)
at com.android.aaptcompiler.ResourceCompiler.access$compileTable(ResourceCompiler.kt:1)
at com.android.aaptcompiler.ResourceCompiler$getCompileMethod$1.invoke(ResourceCompiler.kt:137)
at com.android.aaptcompiler.ResourceCompiler$getCompileMethod$1.invoke(ResourceCompiler.kt:137)
at com.android.aaptcompiler.ResourceCompiler.compileResource(ResourceCompiler.kt:123)
... 29 more
Thanks a lot
EDIT :
So, I've searched a lot, tried many things but none of them worked. Because my project is still small, I created a new project and copy/paste all my code and I this new project everything work and I don't have any error anymore.
Good luck if you encounter the same error.
Just had this error myself and after awhile managed to find the issue, I had strings within array-lists located in my strings.xml, some of my strings included apostrophes, for instance in don't won't can't.
Removing these allowed me to build my project again.
The solution that worked for me is locate the String.xml file. Delete the unused Strings I meant the strings that didnt had any reference in arrayList file.
Make sure gradle offline mode is not enabled.
Then do file->invalidate
then click invalidate and restart.
This should solve the issue
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
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.
I just import project.I get error signs at res and src folders. I decided to create a project from existing code.I still get error.I get errors not for all project but for a few projects,mainly all google samples:
java.lang.reflect.InvocationTargetException
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:677)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:590)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$3.execute(NewProjectCreator.java:400)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:175)
at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
at org.eclipse.core.internal.resources.Project.create(Project.java:287)
at org.eclipse.core.internal.resources.Project.create(Project.java:269)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:727)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:660)
... 6 more
Root exception:
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:175)
at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
at org.eclipse.core.internal.resources.Project.create(Project.java:287)
at org.eclipse.core.internal.resources.Project.create(Project.java:269)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createEclipseProject(NewProjectCreator.java:727)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.createProjectAsync(NewProjectCreator.java:660)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator.access$0(NewProjectCreator.java:590)
at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator$3.execute(NewProjectCreator.java:400)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Contains: OK
Contains: C:\Users\ramapriya\workspace\InteractiveChart overlaps the location of another project: 'InteractiveChart'
I restarted eclipse.my computer,cleared all projects.Got no clue how to solve this.
Thanks
EDIT: I need to mention that some projects run successfully with no errors(before) now show errors.The projects work just fine/
So I tried changing the themes,the java files.Nothing worked.All I had to do was:
Go to project properties(Right Click your project)
Go to Android Target,Click most Recent.
Ok, Apply,there you go! :D
I want to know how to show compilation errors in Android Studio. I tried the following one:
Android Studio: Where is the Compiler Error Output Window?
But it is showing another error:
javac: invalid target release: 1.8
Anybody who knows the actual solution please reply.
There is a 'Problems' view in the project window:
Just click on the drop down (Android setting is default) and select 'Problems'. Not comparable to eclipse problems view tough...
Using F2
In addition to what the other answers say, you can find errors by pressing F2 or Shift+F2. This is useful when you can't see the where the red indicator is on the side bar.
There's "Messages" tab in Android Studio. Complilation errors and warning go there. You can select it by pressing alt+0 (⌘+0 in OS X - a shortcut to View|Tool Windows|Messages).
I was looking for the "Problems" view that you can see in Eclipse when building projects. For that, you can go to Analyze -> Inspect Code
Where is the warnings view in Android Studio?
and then I clicked on "Group by Severity" so that I could see the warnings and errors.
In the toolbar, go to Analyze -> Inspect Code
After That, you will have the Inspection Results window with the detailed errors and warnings. see image:
Next / Previous highlighted error: F2/Shift + F2
Show descriptions of error at caret: Ctrl+F1