Android SDK 31和KAPT对JDK 11的依赖



我试图用API 31升级我的应用程序的compilesdk。我的应用程序依赖于KAPT。当我用kapt和SDK 30和jdk 8构建我的应用程序时,应用程序构建良好并运行。但当我将sdk版本增加到31时我开始看到下面的error:

An exception has occurred in the compiler (1.8.0_332). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
.....
....
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:750)

这个东西有用。Myapp + SDK 30+ jdk8 + kapt = workingMyapp + SDK 31 + JDK 8 + kapt =不工作

myapp+ SDK 31 + JDK 11 + kapt = workingMyapp + SDK 31 + JDK 8 - kapt = working

我想知道,为什么会发生这种事。为什么需要JDK 11和sdk 31来构建与JDK 8和sdk 30一起工作的kapt依赖?

同样的问题,但不确定为什么。

要让它工作,我去设置在构建、执行、部署;构建工具>Gradle祝辞Gradle JDK:——>设置为11

这里有一个与此相关的好答案https://stackoverflow.com/a/69250502/10189554

相关内容

  • 没有找到相关文章

最新更新