Android build 生成“编译器消息文件已损坏”

Android build yields "compiler message file broken"

提问人:juliusspencer 提问时间:10/10/2022 最后编辑:juliusspencer 更新时间:10/10/2022 访问量:57

问:

在 Docker 容器中构建 Android 项目时 () 我收到以下错误:openjdk:11-jdk

:app:compileDebugJavaWithJavac (Thread[Execution worker for ':',5,main]) completed. Took 8.302 secs.
AAPT2 aapt2-7.1.3-7984345-linux Daemon #0: shutdown
AAPT2 aapt2-7.1.3-7984345-linux Daemon #1: shutdown

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

堆栈跟踪的详细信息如下:

compiler message file broken: key=compiler.misc.msg.bug arguments=11.0.16, {1}, {2}, {3}, {4}, {5}, {6}, {7}
java.lang.AssertionError
    at jdk.compiler/com.sun.tools.javac.code.Symbol.clone(Symbol.java:288)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.binaryQualifier(Gen.java:248)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitIdent(Gen.java:2064)
    at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2264)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:819)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitAssign(Gen.java:1806)
    at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1894)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:819)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitExec(Gen.java:1594)
    at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1468)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:632)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:618)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStats(Gen.java:669)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:1031)
    at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1036)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:632)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:903)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:866)
    at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
    at jdk.compiler/com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2202)
    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:756)
    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1631)
    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1599)
    at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973)
    at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
    at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
    at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
    at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
    at org.gradle.internal.compiler.java.IncrementalCompileTask.call(IncrementalCompileTask.java:89)
...

我尝试使用与我的 Android Studio 11.0.12 中当前相同的 java 版本,但收到相同的错误。

我也尝试过跑步,但没有得到任何进一步的信息。--debug--full-stacktrace

有没有办法在项目上下文中了解有关此错误的更多信息?

构建 android-gradle-plugin java-11

评论


答: 暂无答案