Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrolambda breaks lint #96

Closed
ZacSweers opened this issue Apr 7, 2015 · 34 comments
Closed

Retrolambda breaks lint #96

ZacSweers opened this issue Apr 7, 2015 · 34 comments

Comments

@ZacSweers
Copy link

Related to #69, but figured I'd open a more general issue for discussion and the hope that someone has come up with a creative solution to this.

As of right now, the version of Lombok used by the linter doesn't support lambdas, which causes it to fall over during linting (example output below). This is a dealbreaker for many, as lint is an important tool for catching issues and can also double back as a data generator for scripting tools (like removing unused resources).

An ideal solution would probably be a recompiled version of the linter with an updated Lombok dependency that supports Java 8.

A possible alternative could be adding a rule to somehow skip LambdaExpression nodes in the AST during processing, though I think this would come at the expense of knowing anything inside the lambda.

Example output of the exception encountered:

Failed converting ECJ parse tree to Lombok for file someclass.java
java.lang.UnsupportedOperationException: Unknown ASTNode child: LambdaExpression
    at lombok.ast.ecj.EcjTreeVisitor.visitOther(EcjTreeVisitor.java:368)
    at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:364)
    at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
    at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
    at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
    at lombok.ast.ecj.EcjTreeConverter$2.visitMessageSend(EcjTreeConverter.java:1042)
    at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:156)
    at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
    at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
    at lombok.ast.ecj.EcjTreeConverter.toBlock(EcjTreeConverter.java:397)
    at lombok.ast.ecj.EcjTreeConverter.access$1500(EcjTreeConverter.java:141)
    at lombok.ast.ecj.EcjTreeConverter$2.visitConstructorDeclaration(EcjTreeConverter.java:1194)
    at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:252)
    at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
    at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
    at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
    at lombok.ast.ecj.EcjTreeConverter$2.createNormalTypeBody(EcjTreeConverter.java:563)
    at lombok.ast.ecj.EcjTreeConverter$2.visitTypeDeclaration(EcjTreeConverter.java:486)
    at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:48)
    at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
    at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
    at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
    at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
    at lombok.ast.ecj.EcjTreeConverter$2.visitCompilationUnitDeclaration(EcjTreeConverter.java:441)
    at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:264)
    at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
    at com.android.tools.lint.EcjParser.parseJava(EcjParser.java:407)
    at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:236)
    at com.android.tools.lint.client.api.LintDriver.checkJava(LintDriver.java:1491)
    at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:1026)
    at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:882)
    at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:433)
    at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:374)
    at com.android.tools.lint.LintCliClient.run(LintCliClient.java:130)
    at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:112)
    at com.android.build.gradle.internal.LintGradleClient$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at com.android.build.gradle.tasks.Lint.runLint(Lint.groovy:198)
    at com.android.build.gradle.tasks.Lint.this$4$runLint(Lint.groovy)
    at com.android.build.gradle.tasks.Lint$this$4$runLint$1.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
    at com.android.build.gradle.tasks.Lint.lintSingleVariant(Lint.groovy:173)
    at com.android.build.gradle.tasks.Lint$lintSingleVariant$0.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.android.build.gradle.tasks.Lint.lint(Lint.groovy:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
    at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:46)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
@pietrodev
Copy link

I found this bug too this morning and the problem seems related to the new lint version.
In fact this morning I tried the new retrolambda-gradle-plugin ver. 3.0.1 with new retrolambda ver. 2.0.2 and from command line gradle downloaded some new plugins for the build (I didn't care at the beginning, I thought they were related). Then this error happened.
I tried to revert retrolambda changes and rollback to plugin 2.5.0 with retrolambda ver. 1.8.0 but the error remained. So I tried some changes in the build until I found that lint was updated too to version 24.1.0.
So I modified the gradle dependencies to use lint 24.0.0 and all worked again.
So there must be something in the new lint version that breaks retrolambda, I do not know if retrolambda author can do anything about it.
For now my solution is to use the old lint plugin.

@ZacSweers
Copy link
Author

@pietrodev could you give an example of what dependency you changed to use that version of lint? I wasn't aware we could specify different versions.

@pietrodev
Copy link

Yes, of course all gradle modules must specify the version for every dependencies. I didn't know at the beginning where to find that one, but I searched the .gradle directory for files containing lint and I found this one:

HOME.gradle\caches\modules-2\metadata-2.14\descriptors\com.android.tools.build\gradle-core\1.1.0\22da77b0d76ea8df17298218f3ec1f87\ivy.xml

Yours may be a different version.

Inside the file you find:

<dependency org="com.android.tools.lint" name="lint" rev="24.1.0" force="true" conf="runtime-&gt;compile(*),runtime(*),master(*)"/>

Just change the 24.1.0. to 24.0.0 and recompile

@evant
Copy link
Owner

evant commented Apr 16, 2015

@pietrodev just to note, lint has never worked with retrolambda, it is just now failing loudly. Before it would silently skip the rest of your file if it encountered a lambda. See #69.

@pietrodev
Copy link

@evant Thanks, I didn't know this.
I'm sure that lint correctly output errors if something is wrong in resources (e.g., XML), you are saying that this version skips unreadable class files? Thanks.

@evant
Copy link
Owner

evant commented Apr 16, 2015

Well, unreadable source files, class files should work since it would be reading the output from retrolambda. (lint does both)

@evant
Copy link
Owner

evant commented May 3, 2015

I think I may have come up with a solution to this. Basically I forked lombok ast used by lint and modified it a bit to not fail on java 8 features. With a little gradle magic it's easy to replace with my version. Let me know what you think! https://github.com/evant/android-retrolambda-lombok

@ZacSweers
Copy link
Author

ZacSweers commented May 3, 2015

Does it check the code in these blocks or does it just skip them while
traversing the AST? Either way, definitely good to hear and look forward to
trying it out!
On Sat, May 2, 2015 at 8:35 PM Evan Tatarka notifications@github.com
wrote:

I think I may have come up with a solution to this. Basically I forked
lombok ast used by lint and modified it a bit to not fail on java 8
features. With a little gradle magic it's easy to replace with my version.
Let me know what you think!
https://github.com/evant/android-retrolambda-lombok


Reply to this email directly or view it on GitHub
#96 (comment)
.

@evant
Copy link
Owner

evant commented May 3, 2015

It just turns the "lambda" node into a "statement" node which is good enough for lint to detect unused resources and such. It would be technically be better to fully implement the new ast nodes, but since none of the lint passes expect them, cheating seems to be good enough.

@ZacSweers
Copy link
Author

Interesting. Same result for method references as well?
On Sat, May 2, 2015 at 8:41 PM Evan Tatarka notifications@github.com
wrote:

It just tuns the "lambda" node into a "statement" node which is good
enough for lint to detect unused resources and such. It would be
technically be better to fully implement the new ast nodes, but since none
of the lint passes expect them, cheating seems to be good enough.


Reply to this email directly or view it on GitHub
#96 (comment)
.

@evant
Copy link
Owner

evant commented May 3, 2015

Method references are replaced with "null". Both these choices may have to be revisited if it trips up any of the lints, but I haven't seen any issues with might light testing.

@ZacSweers
Copy link
Author

Cool, I'll do some thorough testing as well and report in on the new repo

manvir-singh added a commit to manvir-singh/SnapColors that referenced this issue May 14, 2015
@teddis
Copy link

teddis commented Jun 8, 2015

Any resolution to this? I am getting the same loud errors. Thanks.

@evant
Copy link
Owner

evant commented Jun 8, 2015

@Nilzor
Copy link

Nilzor commented Jun 15, 2015

@evant I can't get that routine to work (android-retrolambda-lombok). It still outputs all the errors although I've configured the plugin correctly under the buildscript dependencies. You say "run gradle with java 1.8". How do I ensure that?

@evant
Copy link
Owner

evant commented Jun 15, 2015

"run gradle with java 1.8" just means that you have JAVA_HOME or your jdk path in android studio set to java 8. Are you sure you have applied the configuration to all the buildscript blocks in your project? You can use

task printBuildScriptClasspath << {
    println project.buildscript.configurations.classpath.asPath
}

to print out the classpath and ensure it's properly removing the original dependency and adding this one.

@jhirn
Copy link

jhirn commented Jul 13, 2015

I'm still having issues with this. Here is my build output:

:app:preBuild UP-TO-DATE
...
:app:lint
Wrote HTML report to file:/Users/jhirn/src/company/booth/booth-performance-tracker-android/app/build/outputs/lint-results.html
Wrote XML report to /Users/jhirn/src/company/booth/booth-performance-tracker-android/app/build/outputs/lint-results.xml
:app:lint FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Total time: 2.483 secs

Here is the output of printBuildScriptClasspath from above. As you can see, it's including 0.2.3a version of lombok and excluding com.android.tools.external version.

jhirn@MacBook-Pro ~/s/d/b/booth-performance-tracker-android (master)> gradle clean printBuildScriptClasspath
:app:clean UP-TO-DATE
:printBuildScriptClasspath
/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle/1.2.3/2fc5a2f1ac2e86c5c4bb57241330198b2355e621/gradle-1.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/me.tatarka/gradle-retrolambda/3.2.0/ff2fd7fe6e510caed8ab1289d6cd8ed56b827235/gradle-retrolambda-3.2.0.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/me.tatarka.retrolambda.projectlombok/lombok.ast/0.2.3.a2/e649c244b625ffb9021b3f6debde350a74e46b62/lombok.ast-0.2.3.a2.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle-core/1.2.3/4a448f6ea508a2b547a3fea4033d2b68d287a188/gradle-core-1.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/builder/1.2.3/4530e2d560877a7a514b63500e7263c973ee2413/builder-1.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint/24.2.3/3b2976b2b1b2e8cb13cb2224da81f624081db38a/lint-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/net.sf.proguard/proguard-gradle/5.1/672d43cbfde4765080e5bea19c51a2cc45dfc00/proguard-gradle-5.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/builder-model/1.2.3/31a6a8af1d5a4f528a5d0fa567fcd8234d100bd1/builder-model-1.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/builder-test-api/1.2.3/821301502b154d3a66d93b72bcb9ffeba4487acd/builder-test-api-1.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools/sdklib/24.2.3/2e1b33d6544db11d30fa0037ee6751675ae42329/sdklib-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools/sdk-common/24.2.3/c59b15bdc3aaf46b13491827d8a6abaa6d5213b3/sdk-common-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools/common/24.2.3/1bcbdeecd08852eba2954b8376ef8cbf7704b39b/common-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.build/manifest-merger/24.2.3/ac192088836974da767392eadc3beb16d37b65b3/manifest-merger-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.ddms/ddmlib/24.2.3/72e612ad93e7b12d8f71c584f1f65a81e864e4de/ddmlib-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.squareup/javawriter/2.5.0/81241ff7078ef14f42ea2a8995fa09c096256e6b/javawriter-2.5.0.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcpkix-jdk15on/1.48/28b7614b908a47844bb27e3c94b45b6893656265/bcpkix-jdk15on-1.48.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.48/960dea7c9181ba0b17e8bab0c06a43f0a5f04e65/bcprov-jdk15on-1.48.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/5.0.3/dcc2193db20e19e1feca8b1240dbbc4e190824fa/asm-5.0.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/5.0.3/287749b48ba7162fb67c93a026d690b29f410bed/asm-tree-5.0.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a60a5e993c98c864010053cb901b7eab25306568/gson-2.2.4.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-checks/24.2.3/59fb927f5817e16796297140add6c879ee752f37/lint-checks-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.eclipse.jdt.core.compiler/ecj/4.4/fe0a961ce7cca03dd3c9b3775c0133229e8231a6/ecj-4.4.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/net.sf.proguard/proguard-base/5.1/dc606dd778fe4685be16d5a171782ccfe0ef5637/proguard-base-5.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools/annotations/24.2.3/5cfce42220293835e7988ceefd9b0f4e9f284791/annotations-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.layoutlib/layoutlib-api/24.2.3/267861b0cc93c5c9cf85d901e9e1e975ae109fd/layoutlib-api-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools/dvlib/24.2.3/14e95bd58c53762138210f48eeb5d670e11ccdba/dvlib-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/a698750c16740fd5b3871425f4cb3bbaa87f529d/commons-compress-1.8.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.1.1/3d1d918f32709e33ba7ddb2c4e8d1c543ebe713e/httpclient-4.1.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.1/9ba2dcdf94ce35c8a8e9bff242db0618ca932e92/httpmime-4.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/17.0/9c6ef172e8de35fd8d4d8783e4821e57cdef7445/guava-17.0.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/net.sf.kxml/kxml2/2.3.0/ccbc77a5fd907ef863c29f3596c6f54ffa4e9442/kxml2-2.3.0.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-api/24.2.3/c3648cf4ae2ff004360e31ed177271d88ecd093a/lint-api-24.2.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/5.0.3/c7126aded0e8e13fed5f913559a0dd7b770a10f3/asm-analysis-5.0.3.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.1/33fc26c02f8043ab0ede19eadc8c9885386b255c/httpcore-4.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.1/5043bfebc3db072ed80fbd362e7caf00e885d8ae/commons-logging-1.1.1.jar:/Users/jhirn/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.4/4216af16d38465bbab0f3dff8efa14204f7a399a/commons-codec-1.4.jar

Let me know if there's anything else I can provide.

@evant
Copy link
Owner

evant commented Jul 13, 2015

Um, you sure you don't actually have lint errors? You'd normally get a stacktrace like posted in this issue when it hits a file with lamdba instead of it succeeding like that.

@jhirn
Copy link

jhirn commented Jul 13, 2015

Perhaps you are correct. I just saw build failed but this did remove the original stack trace.

I'll report back when I figure it out but I don't think this is your problem. Thanks a lot!

Edit: Yes, other build issues. Thanks so much again for the help!

@vanniktech
Copy link

Is there any workaround? Since I don't want to give Lint up.

@sergejsha
Copy link

@vanniktech Use https://github.com/evant/android-retrolambda-lombok project mentioned above. It worked out well for me.

pennadev pushed a commit to pennadev/MVVM_Hacker_News that referenced this issue Sep 16, 2015
ragnor-rs added a commit to ragnor-rs/mvp-sandbox that referenced this issue Nov 20, 2015
filipebezerra added a commit to filipebezerra/podcasts-da-bel-app-android-java that referenced this issue Dec 6, 2015
@orrc
Copy link

orrc commented Feb 12, 2016

Workaround works great, thanks.

I've also filed this as http://b.android.com/200887 since it doesn't seem to have been reported to the Android tools team so far.

iumehara pushed a commit to vmware-archive/osusume-android that referenced this issue Feb 24, 2016
Hopefully we can remove projectlombok when evant/gradle-retrolambda#96 is fixed.

Signed-off-by: Ichizo Umehara <iumehara@pivotal.io>
@PaulWoitaschek
Copy link

I don't fully get it. Is is somehow possible to the inspection about unused strings, layouts and drawables correct?

@ypresto
Copy link

ypresto commented May 12, 2016

This workaround does not fixes false-positives on Android Studio which has bundled lombok jar.

@xiaoxuetu
Copy link

xiaoxuetu commented Jun 17, 2016

This error happened with JDK 7, how can i solve it ?

@kenyee
Copy link

kenyee commented Aug 9, 2016

Puzzled...anyone see what's wrong my classpath? Looks like it includes the new lombok.ast from running the :printBuildScriptClasspath task and I'm running Java 8_102 because I know JDK7 doesn't work with this workaround:
/Users/kyee/.gradle/caches/modules-2/files-2.1/io.fabric.tools/gradle/1.21.6/7541138adccc5e72d9fc32e95edaf907ed647911/gradle-1.21.6.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/me.tatarka/gradle-retrolambda/3.2.1/46a623400a717480935bda972aa652c55140df22/gradle-retrolambda-3.2.1.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/me.tatarka.retrolambda.projectlombok/lombok.ast/0.2.3.a2/e649c244b625ffb9021b3f6debde350a74e46b62/lombok.ast-0.2.3.a2.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin/1.0.3/2cced5fa42feee10f642f5c3083bad466abfaa29/kotlin-gradle-plugin-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-android-extensions/1.0.3/a339cb9b029182771f284dfd0c98aae1490de515/kotlin-android-extensions-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.0.3/20738122b53399036c321eeb84687367757d622a/kotlin-stdlib-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin-core/1.0.3/8bb84589f20b2bed4ba81817a36ff0c722e23796/kotlin-gradle-plugin-core-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin-api/1.0.3/249fe2d8195fc3474631e8adffb2232ef164eb99/kotlin-gradle-plugin-api-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.0.3/8d605894ceb1f870e8a6e62ebb6ff36ac3aa215b/kotlin-compiler-embeddable-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-runtime/1.0.3/10f40d016700cf4287e49fa1d51c2a8507e9b946/kotlin-runtime-1.0.3.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.4/b1b6ea3b7e4aa4f492509a4952029cd8e48019ad/commons-io-2.4.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/ce1edb914c94ebc388f086c6827e8bdeec71ac2/commons-lang-2.6.jar:/Users/kyee/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-annotation-processing/1.0.3/12398f02af05a170664886894c7cd7e063585d5b/kotlin-annotation-processing-1.0.3.jar

The build script looks right too :-(

   dependencies {
        classpath "io.fabric.tools:gradle:${fabricPluginVersion}"
        classpath "me.tatarka:gradle-retrolambda:${retrolambdaPluginVersion}"
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"
    }

    // Exclude the broken lombok version that the android plugin depends on.
    // see: https://github.com/evant/android-retrolambda-lombok
    configurations.classpath.exclude group: 'com.android.tools.external.lombok'

I still get:

java.lang.UnsupportedOperationException: Unknown ASTNode child: LambdaExpression
        at lombok.ast.ecj.EcjTreeVisitor.visitOther(EcjTreeVisitor.java:368)

kibotu added a commit to kibotu/common.android.utils that referenced this issue Aug 10, 2016
@kenyee
Copy link

kenyee commented Aug 11, 2016

FYI, the 2.2.0-beta1 plugin seems to fix not being able to see unused resources even though it still spews lots of errors out. It also gives random "unsupported major.minor version 52.0" errors so I wouldn't upgrade to it yet, but there's some hope of having a useful lint again for those of us who couldn't get the workaround working...

@ikravchenko
Copy link

the problem is still reproducible when using retrolambda-lombok.
Gradle runs under JAVA 8, the root config is the following:


ext {
    minSdkVersion = 21
    compileSdkVersion = 24
    targetSdkVersion = 24
    buildToolsVersion = '24.0.0'
}

allprojects {
    buildscript {
        repositories {
            maven {
                url 'http://rndbit01:14000/artifactory/plugins-release'
            }
        }

        dependencies {
            classpath "com.android.tools.build:gradle:2.2.2"
            classpath "me.tatarka:gradle-retrolambda:3.3.1"
            classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
            classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
            classpath 'com.squareup.sqldelight:gradle-plugin:0.5.0'
        }

        // Exclude the version that the android plugin depends on.
        configurations.classpath.exclude group: 'com.android.tools.external.lombok'
    }

    repositories {
        maven {
            url 'http://rndbit01:14000/artifactory/libs-release'
        }

        maven {
            url 'http://rndbit01:14000/artifactory/libs-snapshot'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

task printBuildScriptClasspath << {
    println project.buildscript.configurations.classpath.asPath
}

lint xml contains try with resources ignore statement but I still get problems like:

ECJ compiler crashed processing /.../GetPermissionFramesCommand.java
java.lang.NullPointerException
        at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2804)
        at org.eclipse.jdt.internal.compiler.ast.ReferenceExpression.isPotentiallyCompatibleWith(ReferenceExpression.java:1003)
        at org.eclipse.jdt.internal.compiler.lookup.ConstraintExpressionFormula.reduce(ConstraintExpressionFormula.java:62)
        at org.eclipse.jdt.internal.compiler.lookup.BoundSet.reduceOneConstraint(BoundSet.java:844)
        at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.reduce(InferenceContext18.java:861)
        at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:812)
        at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:234)
        at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:82)
        at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:743)
        at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:700)
        at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1645)
        at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1546)
        at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:680)
        at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:619)
        at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1020)
        at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641)
        at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:309)
        at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551)
        at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1188)
        at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1301)
        at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:590)
        at com.android.tools.lint.EcjParser$NonGeneratingCompiler.process(EcjParser.java:1325)
        at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:546)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:458)
        at com.android.tools.lint.EcjParser.parse(EcjParser.java:486)
        at com.android.tools.lint.EcjParser.prepareJavaParse(EcjParser.java:269)
        at com.android.tools.lint.client.api.JavaVisitor.prepare(JavaVisitor.java:358)
        at com.android.tools.lint.client.api.LintDriver.visitJavaFiles(LintDriver.java:1617)
        at com.android.tools.lint.client.api.LintDriver.checkJava(LintDriver.java:1551)
        at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:1090)
        at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:935)
        at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:454)
        at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:395)
        at com.android.tools.lint.LintCliClient.run(LintCliClient.java:131)
        at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:146)
        at com.android.build.gradle.tasks.Lint.runLint(Lint.java:255)
        at com.android.build.gradle.tasks.Lint.lintAllVariants(Lint.java:129)
        at com.android.build.gradle.tasks.Lint.lint(Lint.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Additional lint config is the following:

android {
    lintOptions {
        abortOnError true
        xmlReport true
        htmlReport true
        checkReleaseBuilds false
        disable 'GoogleAppIndexingWarning'
        htmlOutput file("$project.buildDir/reports/lint/lint-result.html")
        xmlOutput file("$project.buildDir/reports/lint/lint-result.xml")
        lintConfig file("${project.rootDir}/config/quality/lint/lint.xml")
    }
}

Could you please tell where the problem can be?

@oliverdain
Copy link

The https://github.com/evant/android-retrolambda-lombok script did not work for me. I suspect that may be because my resources are being used in Kotlin via Anko. The anko layouts are in Kotlin lambdas - I have no idea how Kotlin/retrolambda processes those.

Here's an example:

class WelcomePageUi : AnkoComponent<Context> {
    override fun createView(ui: AnkoContext<Context>): View = with(ui) {
        verticalLayout(R.style.AppTheme) {
            padding = dip(16)

            textView(text = R.string.welcome) {
                textColor = ContextCompat.getColor(this.context, android.R.color.white)
                textSize = 35f
                gravity = Gravity.CENTER_HORIZONTAL
            }.lparams(width = matchParent, height = wrapContent)

            imageView(imageResource = R.drawable.xprize_welcome) {
                adjustViewBounds = true
                scaleType = ImageView.ScaleType.FIT_CENTER
            }.lparams(width = matchParent, height = wrapContent) {
                topMargin = dip(50)
            }

            space().lparams {
                weight = 1f
            }

            textView(text = R.string.start) {
                // textColor = ContextCompat.getColor(this.context, android.R.color.white)
                textColor = Color.WHITE
                textSize = 20f
                gravity = Gravity.CENTER_HORIZONTAL
            }.lparams(width = matchParent, height = wrapContent)
        }
    }
}

@felipecsl
Copy link

@oliverdain I don't think this is related to Kotlin. We have a pure Java project and it doesn't work either

@felipecsl
Copy link

I've confirmed that this issue is caused by having custom lint rules that use the old and deprecated lombok AST API. If you migrate all your custom lint rules to the PSI API, then the errors go away.
Butterknife has been fixed on 8.4.1-SNAPSHOT already.
You might have other dependencies that include custom lint rules, though. One example is braintree/braintree_android, which I'm gonna work on migrating now.

@vanniktech
Copy link

I also think that Timber has custom lint rules that are using the old format. (Haven't checked it though)

@felipecsl
Copy link

felipecsl commented Nov 23, 2016

@vanniktech that's right. We don't use timber, but if anyone wants to send a PR, that would be great :)

@eliasbagley
Copy link

@vanniktech @felipecsl Timber dev branch has this issue fixed, but it hasn't been picked up by the latest release yet. In the meantime, I'm using jitpack to pull it in. Confirmed that this fixes all my lombok lint issues. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests