qq_35944535 2021-12-25 09:25 采纳率: 33.3%
浏览 421
已结题

Ubuntu版本 16.04 编译Android 11 无法通过

FAILED: out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/platformprotos.jar
rm -rf "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/classes" "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/anno" "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars" && mkdir -p "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/classes" "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/anno" "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars" && out/soong/host/linux-x86/bin/zipsync -d out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars -l out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/list -f "*.java" out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/gen/proto/proto0.srcjar out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/gen/proto/proto1.srcjar && (if [ -s out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/list ] || [ -s out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/platformprotos.jar.rsp ] ; then out/soong/host/linux-x86/bin/soong_javac_wrapper prebuilts/jdk/jdk11/linux-x86/bin/javac -J-Xmx2048M -J-XX:OnError="cat hs_err_pid%p.log" -J-XX:CICompilerCount=6 -J-XX:+UseDynamicNumberOfGCThreads -Xmaxerrs 9999999 -encoding UTF-8 -sourcepath "" -g -XDskipDuplicateBridges=true -XDstringConcat=inline -proc:none -g:source,lines -Xlint:-dep-ann -classpath out/soong/.intermediates/external/protobuf/libprotobuf-java-full/linux_glibc_common/javac/libprotobuf-java-full.jar -source 1.9 -target 1.9 -d out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/classes -s out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/anno @out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/platformprotos.jar.rsp @out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/list ; fi ) && out/soong/host/linux-x86/bin/soong_zip -jar -o out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/platformprotos.jar -C out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/classes -D out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/classes && rm -rf "out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars"
out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/com/android/os/AtomsProto.java:5363: error: not a statement
bluetoothLinkLayerConneed) pushed_).toBuilder();
^
out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/com/android/os/AtomsProto.java:5363: error: ';' expected
bluetoothLinkLayerConneed) pushed_).toBuilder();
^
out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/com/android/os/AtomsProto.java:5363: error: not a statement
bluetoothLinkLayerConneed) pushed_).toBuilder();
^
out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/com/android/os/AtomsProto.java:5363: error: ';' expected
bluetoothLinkLayerConneed) pushed_).toBuilder();
^
out/soong/.intermediates/frameworks/base/platformprotos/linux_glibc_common/javac/srcjars/com/android/os/AtomsProto.java:5374: error: illegal start of type
case 34: {

Android里面是没有这个AtomsProto.java文件的 应该是服务器编译环境问题

  • 写回答

4条回答 默认 最新

  • I_p 2022-10-20 20:41
    关注

    原因:执行frameworks/base/cmds/statsd/src/atoms.proto的解析生成AtomsProto.java文件后,android的编译系统会对这个java文件进行压缩,用的是android编译环境里面的soong_zip工具。soong_zip在多核处理下估计是有bug,会导致文本错位,AtomsProto.java由于代码很多因此很容易出现压缩错误问题,后面就编译失败了。
    修复方法:build/soong/java/proto.go里面,soong_zip压缩指令里面添加参数,强制不使用多核:

    --- a/java/proto.go
    +++ b/java/proto.go
    @@ -49,6 +49,7 @@ func genProto(ctx android.ModuleContext, protoFiles android.Paths, flags android
             // into a srcjar.
             rule.Command().
                 BuiltTool(ctx, "soong_zip").
    +            Flag("-parallel=1").
                 Flag("-jar").
                 Flag("-write_if_changed").
                 FlagWithOutput("-o ", srcJarFile).
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

问题事件

  • 系统已结题 2月10日
  • 已采纳回答 2月2日
  • 创建了问题 12月25日

悬赏问题

  • ¥15 个人通讯录管理系统 C语言 程序设计 需要能运行成功的
  • ¥15 数电设计题 没有设计思路 不知道用什么芯片进行设计 求提供设计思路
  • ¥15 在动态多目标优化问题中,第一幅图展示的是问题DF6的相关定义和绘制的POS和POF图,请问图中公式PS(t)和PF(t)是如何推导的
  • ¥60 先数学建模,接着设计一种优化算法结合案例给出智能仓储四向穿梭车的调度计划
  • ¥15 Errno2:No such file or directory,在当前文件确实没有该图片,怎么解决?
  • ¥15 博世摄像头数据存储的问题(iscsi)
  • ¥15 如何实现对学生籍贯信息管理系统的选择排序
  • ¥15 写一个51单片机的时钟代码
  • ¥15 git clone报错
  • ¥15 3d-slicer超声造影动态图像导入报错