android - Retrolambda: Lint crashes when using lambda expressions with retrolambda -
i'm trying use retrolambda along gradle-retrolambda plugin. in general works fine, when compile release, lint
stage fails exception:
:playground.dagger:lintvitalreleasefailed converting ecj parse tree lombok file d:\....\playground\dagger\mainactivity.java java.lang.unsupportedoperationexception: unknown astnode child: lambdaexpression @ lombok.ast.ecj.ecjtreevisitor.visitother(ecjtreevisitor.java:368) @ lombok.ast.ecj.ecjtreevisitor.visitecjnode(ecjtreevisitor.java:364) @ lombok.ast.ecj.ecjtreeconverter.visit(ecjtreeconverter.java:295) @ lombok.ast.ecj.ecjtreeconverter.totree(ecjtreeconverter.java:236) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:282) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:252) @ lombok.ast.ecj.ecjtreeconverter.access$100(ecjtreeconverter.java:141) @ lombok.ast.ecj.ecjtreeconverter$2.visitmessagesend(ecjtreeconverter.java:1042) @ lombok.ast.ecj.ecjtreevisitor.visitecjnode(ecjtreevisitor.java:156) @ lombok.ast.ecj.ecjtreeconverter.visit(ecjtreeconverter.java:295) @ lombok.ast.ecj.ecjtreeconverter.totree(ecjtreeconverter.java:236) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:282) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:252) @ lombok.ast.ecj.ecjtreeconverter.toblock(ecjtreeconverter.java:397) @ lombok.ast.ecj.ecjtreeconverter.access$1500(ecjtreeconverter.java:141) @ lombok.ast.ecj.ecjtreeconverter$2.visitmethoddeclaration(ecjtreeconverter.java:1241) @ lombok.ast.ecj.ecjtreevisitor.visitecjnode(ecjtreevisitor.java:152) @ lombok.ast.ecj.ecjtreeconverter.visit(ecjtreeconverter.java:295) @ lombok.ast.ecj.ecjtreeconverter.totree(ecjtreeconverter.java:236) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:282) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:252) @ lombok.ast.ecj.ecjtreeconverter.access$100(ecjtreeconverter.java:141) @ lombok.ast.ecj.ecjtreeconverter$2.createnormaltypebody(ecjtreeconverter.java:563) @ lombok.ast.ecj.ecjtreeconverter$2.visittypedeclaration(ecjtreeconverter.java:486) @ lombok.ast.ecj.ecjtreevisitor.visitecjnode(ecjtreevisitor.java:48) @ lombok.ast.ecj.ecjtreeconverter.visit(ecjtreeconverter.java:295) @ lombok.ast.ecj.ecjtreeconverter.totree(ecjtreeconverter.java:236) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:282) @ lombok.ast.ecj.ecjtreeconverter.filllist(ecjtreeconverter.java:252) @ lombok.ast.ecj.ecjtreeconverter.access$100(ecjtreeconverter.java:141) @ lombok.ast.ecj.ecjtreeconverter$2.visitcompilationunitdeclaration(ecjtreeconverter.java:441) @ lombok.ast.ecj.ecjtreevisitor.visitecjnode(ecjtreevisitor.java:264) @ lombok.ast.ecj.ecjtreeconverter.visit(ecjtreeconverter.java:295) @ com.android.tools.lint.ecjparser.parsejava(ecjparser.java:407) @ com.android.tools.lint.client.api.javavisitor.visitfile(javavisitor.java:236) @ com.android.tools.lint.client.api.lintdriver.checkjava(lintdriver.java:1491) @ com.android.tools.lint.client.api.lintdriver.runfiledetectors(lintdriver.java:1026) @ com.android.tools.lint.client.api.lintdriver.checkproject(lintdriver.java:882) @ com.android.tools.lint.client.api.lintdriver.analyze(lintdriver.java:433) @ com.android.tools.lint.client.api.lintdriver.analyze(lintdriver.java:374) @ com.android.tools.lint.lintcliclient.run(lintcliclient.java:130) @ com.android.build.gradle.internal.lintgradleclient.run(lintgradleclient.java:112) @ com.android.build.gradle.internal.lintgradleclient$run.call(unknown source) @ com.android.build.gradle.tasks.lint.runlint(lint.groovy:198) @ com.android.build.gradle.tasks.lint.this$4$runlint(lint.groovy) @ com.android.build.gradle.tasks.lint$this$4$runlint$1.callcurrent(unknown source) @ com.android.build.gradle.tasks.lint.lintsinglevariant(lint.groovy:173) @ com.android.build.gradle.tasks.lint$lintsinglevariant$0.callcurrent(unknown source) @ com.android.build.gradle.tasks.lint.lint(lint.groovy:75) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.gradle.internal.reflect.javamethod.invoke(javamethod.java:63) @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.doexecute(annotationprocessingtaskfactory.java:218) @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.execute(annotationprocessingtaskfactory.java:211) @ org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.execute(annotationprocessingtaskfactory.java:200) @ org.gradle.api.internal.abstracttask$taskactionwrapper.execute(abstracttask.java:579) @ org.gradle.api.internal.abstracttask$taskactionwrapper.execute(abstracttask.java:562) @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeaction(executeactionstaskexecuter.java:80) @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.executeactions(executeactionstaskexecuter.java:61) @ org.gradle.api.internal.tasks.execution.executeactionstaskexecuter.execute(executeactionstaskexecuter.java:46) @ org.gradle.api.internal.tasks.execution.postexecutionanalysistaskexecuter.execute(postexecutionanalysistaskexecuter.java:35) @ org.gradle.api.internal.tasks.execution.skipuptodatetaskexecuter.execute(skipuptodatetaskexecuter.java:64) @ org.gradle.api.internal.tasks.execution.validatingtaskexecuter.execute(validatingtaskexecuter.java:58) @ org.gradle.api.internal.tasks.execution.skipemptysourcefilestaskexecuter.execute(skipemptysourcefilestaskexecuter.java:42) @ org.gradle.api.internal.tasks.execution.skiptaskwithnoactionsexecuter.execute(skiptaskwithnoactionsexecuter.java:52) @ org.gradle.api.internal.tasks.execution.skiponlyiftaskexecuter.execute(skiponlyiftaskexecuter.java:53) @ org.gradle.api.internal.tasks.execution.executeatmostoncetaskexecuter.execute(executeatmostoncetaskexecuter.java:43) @ org.gradle.api.internal.abstracttask.executewithoutthrowingtaskfailure(abstracttask.java:305) @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.executetask(abstracttaskplanexecutor.java:79) @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.processtask(abstracttaskplanexecutor.java:63) @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorworker.run(abstracttaskplanexecutor.java:51) @ org.gradle.execution.taskgraph.defaulttaskplanexecutor.process(defaulttaskplanexecutor.java:23) @ org.gradle.execution.taskgraph.defaulttaskgraphexecuter.execute(defaulttaskgraphexecuter.java:88) @ org.gradle.execution.selectedtaskexecutionaction.execute(selectedtaskexecutionaction.java:29) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:62) @ org.gradle.execution.defaultbuildexecuter.access$200(defaultbuildexecuter.java:23) @ org.gradle.execution.defaultbuildexecuter$2.proceed(defaultbuildexecuter.java:68) @ org.gradle.execution.dryrunbuildexecutionaction.execute(dryrunbuildexecutionaction.java:32) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:62) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecuter.java:55) @ org.gradle.initialization.defaultgradlelauncher.dobuildstages(defaultgradlelauncher.java:149) @ org.gradle.initialization.defaultgradlelauncher.dobuild(defaultgradlelauncher.java:106) @ org.gradle.initialization.defaultgradlelauncher.run(defaultgradlelauncher.java:86) @ org.gradle.launcher.exec.inprocessbuildactionexecuter$defaultbuildcontroller.run(inprocessbuildactionexecuter.java:80) @ org.gradle.tooling.internal.provider.buildmodelaction.run(buildmodelaction.java:43) @ org.gradle.tooling.internal.provider.buildmodelaction.run(buildmodelaction.java:30) @ org.gradle.tooling.internal.provider.configuringbuildaction.run(configuringbuildaction.java:119) @ org.gradle.launcher.exec.inprocessbuildactionexecuter.execute(inprocessbuildactionexecuter.java:36) @ org.gradle.launcher.exec.inprocessbuildactionexecuter.execute(inprocessbuildactionexecuter.java:26) @ org.gradle.launcher.daemon.server.exec.executebuild.dobuild(executebuild.java:47) @ org.gradle.launcher.daemon.server.exec.buildcommandonly.execute(buildcommandonly.java:34) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.watchfordisconnection.execute(watchfordisconnection.java:35) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.resetdeprecationlogger.execute(resetdeprecationlogger.java:24) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.startstopifbuildandstop.execute(startstopifbuildandstop.java:33) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.forwardclientinput$2.call(forwardclientinput.java:71) @ org.gradle.launcher.daemon.server.exec.forwardclientinput$2.call(forwardclientinput.java:69) @ org.gradle.util.swapper.swap(swapper.java:38) @ org.gradle.launcher.daemon.server.exec.forwardclientinput.execute(forwardclientinput.java:69) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.logtoclient.dobuild(logtoclient.java:60) @ org.gradle.launcher.daemon.server.exec.buildcommandonly.execute(buildcommandonly.java:34) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.establishbuildenvironment.dobuild(establishbuildenvironment.java:70) @ org.gradle.launcher.daemon.server.exec.buildcommandonly.execute(buildcommandonly.java:34) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.daemonhygieneaction.execute(daemonhygieneaction.java:39) @ org.gradle.launcher.daemon.server.exec.daemoncommandexecution.proceed(daemoncommandexecution.java:119) @ org.gradle.launcher.daemon.server.exec.startbuildorrespondwithbusy$1.run(startbuildorrespondwithbusy.java:46) @ org.gradle.launcher.daemon.server.daemonstatecoordinator$1.run(daemonstatecoordinator.java:246) @ org.gradle.internal.concurrent.defaultexecutorfactory$stoppableexecutorimpl$1.run(defaultexecutorfactory.java:64) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745)
is there it? of course, trivial work/around disable lint
check release. i'm looking solution, allowing keep lint
.
following app's module build.gradle
:
apply plugin: 'com.android.application' apply plugin: 'me.tatarka.retrolambda' apply plugin: 'com.neenbedankt.android-apt' configurations { apt } android { compileoptions { sourcecompatibility javaversion.version_1_8 targetcompatibility javaversion.version_1_8 } compilesdkversion 22 buildtoolsversion "21.1.2" defaultconfig { minsdkversion 10 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled true shrinkresources true proguardfiles getdefaultproguardfile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } repositories { maven{ url 'https://oss.sonatype.org/content/repositories/snapshots/' } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.jakewharton:butterknife:6.1.0' compile 'com.google.dagger:dagger:2.0-snapshot' compile 'de.greenrobot:eventbus:2.4.0' retrolambdaconfig 'net.orfjackal.retrolambda:retrolambda:1.8.1' apt 'com.google.dagger:dagger-compiler:2.0-snapshot' provided 'org.glassfish:javax.annotation:10.0-b28' }
root build.gradle
:
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' classpath 'me.tatarka:gradle-retrolambda:2.5.0' } } allprojects { repositories { jcenter() } }
you can use special lombok version lint not whine java 8 features.
buildscript { repositories { jcenter() ... } dependencies { classpath 'com.android.tools.build:gradle:<version>' classpath 'me.tatarka:gradle-retrolambda:<version>' classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' } // exclude version android plugin depends on. configurations.classpath.exclude group: 'com.android.tools.external.lombok' }
this way can keep running lint on whole project, latest versions of android gradle plugin.
note: if receive same errors, try put configuration above top build.gradle
file. should work then.
Comments
Post a Comment