gpt4 book ai didi

android - 在分析包含 retrolambda 的类时,Lint 崩溃并出现异常

转载 作者:行者123 更新时间:2023-11-29 19:24:45 25 4
gpt4 key购买 nike

我将 retrolambda 与 android-retrolambda-lombok 一起使用,但在 :app:lintVital** 任务期间 lint 还是崩溃了。

这两个在我的项目 build.gradle 中,我在自述文件中排除了 com.android.tools.external.lombok

classpath 'me.tatarka:gradle-retrolambda:3.4.0'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'

这是堆栈跟踪:

Failed converting ECJ parse tree to PSI for file **DataBase.java
java.lang.IllegalArgumentException: org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:977)
at com.android.tools.lint.psi.EcjPsiBuilder.toFunctionalExpression(EcjPsiBuilder.java:1038)
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:969)
at com.android.tools.lint.psi.EcjPsiBuilder.toArguments(EcjPsiBuilder.java:2281)
at com.android.tools.lint.psi.EcjPsiBuilder.toCallExpression(EcjPsiBuilder.java:1094)
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:959)
at com.android.tools.lint.psi.EcjPsiBuilder.toCallExpression(EcjPsiBuilder.java:1085)
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:959)
at com.android.tools.lint.psi.EcjPsiBuilder.toCallExpression(EcjPsiBuilder.java:1085)
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:959)
at com.android.tools.lint.psi.EcjPsiBuilder.toCallExpression(EcjPsiBuilder.java:1085)
at com.android.tools.lint.psi.EcjPsiBuilder.toExpression(EcjPsiBuilder.java:959)
at com.android.tools.lint.psi.EcjPsiBuilder.toReturnStatement(EcjPsiBuilder.java:2022)
at com.android.tools.lint.psi.EcjPsiBuilder.toStatement(EcjPsiBuilder.java:1861)
at com.android.tools.lint.psi.EcjPsiBuilder.toBlock(EcjPsiBuilder.java:1811)
at com.android.tools.lint.psi.EcjPsiBuilder.toMethod(EcjPsiBuilder.java:913)
at com.android.tools.lint.psi.EcjPsiBuilder.initializeClassBody(EcjPsiBuilder.java:798)
at com.android.tools.lint.psi.EcjPsiBuilder.toClass(EcjPsiBuilder.java:700)
at com.android.tools.lint.psi.EcjPsiBuilder.toFile(EcjPsiBuilder.java:2518)
at com.android.tools.lint.psi.EcjPsiBuilder.create(EcjPsiBuilder.java:387)
at com.android.tools.lint.EcjParser$EcjResult.findFile(EcjParser.java:348)
at com.android.tools.lint.EcjParser.parseJavaToPsi(EcjParser.java:634)
at com.android.tools.lint.client.api.JavaPsiVisitor.visitFile(JavaPsiVisitor.java:277)
at com.android.tools.lint.client.api.LintDriver.visitJavaFiles(LintDriver.java:1571)
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.lintSingleVariant(Lint.java:224)
at com.android.build.gradle.tasks.Lint.lint(Lint.java:109)
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:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:624)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:607)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:45)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
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)

还有一个:

Unexpected failure during lint analysis of App.java (this is a bug in lint or one of the libraries it depends on)
IllegalArgumentException:EcjPsiBuilder.toExpression(EcjPsiBuilder.java:977)<-EcjPsiBuilder.toFunctionalExpression(EcjPsiBuilder.java:1038)<-EcjPsiBuilder.toExpression(EcjPsiBuilder.java:969)<-EcjPsiBuilder.toArguments(EcjPsiBuilder.java:2281)

最佳答案

这是 lint 中的一个错误。当您使用包含通配符的功能方法引用时,看起来会发生这种情况。我可以重现它,所以我已经提交了这个跟踪错误 https://code.google.com/p/android/issues/detail?id=232383我计划将其纳入 2.3。

(遗憾的是,没有解决方法;您唯一能做的就是找到相关的源文件(在堆栈跟踪中列出但在此处编辑,例如 *Database.java),查找您的功能引用 (::),然后尝试删除调用中的泛型,只抑制泛型警告。)

关于android - 在分析包含 retrolambda 的类时,Lint 崩溃并出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41632114/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com