After updating lint to version 7.0.2. I get an error in task
app:lintDebug
Error: Unexpected failure during lint analysis of SomeClass.kt (this is a bug in lint or one of the libraries it depends on)
and in stack trace I can see the error
Stack: StackOverflowError:KotlinUMethod$Companion.access$getKotlinMemberOrigin(KotlinUMethod.kt:129)?KotlinUMethod.<init>(KotlinUMethod.kt:38)?KotlinUMethod$Companion.create(KotlinUMethod.kt:147)?KotlinConverter$convertDeclaration$5$1.invoke(KotlinUastLanguagePlugin.kt:538)?KotlinConverter$convertDeclaration$5$1.invoke(KotlinUastLanguagePlugin.kt:200)?KotlinConverter$convertDeclaration$1$1.invoke(KotlinUastLanguagePlugin.kt:517)?KotlinConverter$convertDeclaration$1$1.invoke(KotlinUastLanguagePlugin.kt:200)?KotlinConverter.convertDeclaration$kotlin_uast_uast_kotlin(KotlinUastLanguagePlugin.kt:861)
Somebody know the solution for this problem?
Related
While running lint a strange error occurred. This appears to happen after a androidx.lifecycle update from 2.2.0 to 2.3.0:
../../src/main/java/my/project/MyService.kt: Unexpected failure during lint analysis of MyService.kt
(this is a bug in lint or one of the libraries it depends on)
Message: org.jetbrains.uast.UastErrorType cannot be cast to com.intellij.psi.PsiClassType
The crash seems to involve the detector androidx.lifecycle.lint.NonNullableMutableLiveDataDetector.
You can try disabling it with something like this:
android {
lintOptions {
disable "NullSafeMutableLiveData"
}
}
Stack: ClassCastException:NonNullableMutableLiveDataDetector.visitMethodCall(NonNullableMutableLiveDataDetector.kt:103)
←UElementVisitor$DelegatingPsiVisitor.visitMethodCallExpression(UElementVisitor.kt:1079)
←UElementVisitor$DelegatingPsiVisitor.visitCallExpression(UElementVisitor.kt:1059)
←UCallExpression$DefaultImpls.accept(UCallExpression.kt:85)
←UCallExpressionEx$DefaultImpls.accept(UCallExpression.kt:-1)
←KotlinUSimpleReferenceExpression$KotlinAccessorCallExpression.accept(KotlinUSimpleReferenceExpression.kt:129)
←KotlinUSimpleReferenceExpression.visitAccessorCalls(KotlinUSimpleReferenceExpression.kt:116)
←KotlinUSimpleReferenceExpression.accept(KotlinUSimpleReferenceExpression.kt:83)
You can set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout.
This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.
These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.
To suppress this error, use the issue id "LintError" as explained in the Suppressing Warnings and Errors section.
When I disable NullSafeMutableLiveData - as suggested - the error doesn't occur anymore, great! But I wonder where this issue comes from and if there's a better solution than simply ignoring that specific check completely. Is it a bug in the androidx.lifecycle dependency I could report, or is it possible to somehow conflict with an error in my project I could fix? (if so, any advice finding out where?)
Note: this only happened when lint was run on Bitrise, I didn't encounter this when running lint in Android Studio. Not sure if this is somehow related though.
I'm using Ionic and this is the message:
BUILD FAILED C:\adt\sdk\tools\ant\build.xml:720: The following error
occurred while executing this line:
C:\adt\sdk\tools\ant\build.xml:734: Compile failed; see the compiler
error output for details.
Total time: 5 seconds
C:\wamp\www\external\projectx\dirx\platforms\android\cordova\node_modules\q\q.js:126
Where can I see the log details? I've tried googling a bunch of things like "ionic log path" etc but nothing comes up. I saw something else that said run it with a -c argument but the output is the same.
Make sure you update your sdk, sometimes error occur when trying to build android incompatible API to your cordova version or ionic.
I am try to build android apps but while creating apps my build failed with following errors.
D:\ibm\AnywhereWorkManager\build.xml:87: The following error occurred
while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:720: The
following error occurred while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:716: Failed
building application:
com.worklight.builder.exception.WorklightBuildException:
java.io.IOException: Unable to delete directory
D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo.
at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
I know this answer might seem obvious, but if you have any of the files mentioned in the failure (D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo)
open ( commandline, eclipse, other editor), this will cause the 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.
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...