简体   繁体   English

android p 构建失败 - apache-xml_intermediates - hiddenapi

[英]android p build failing - apache-xml_intermediates - hiddenapi

Ubuntu 18.04 Ubuntu 18.04

Android P安卓P

repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r60回购初始化 -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r60

Any idea what's going on here?知道这里发生了什么吗? I'm guessing this is a difference in Java environment since the hiddenapi binary seems to fail but the build seems to be picking up the java bundled in the source tree so it should work.我猜这是 Java 环境中的一个差异,因为 hiddenapi 二进制文件似乎失败了,但构建似乎正在获取源树中捆绑的 java,所以它应该可以工作。 I deleted all java packages before this build.我在此构建之前删除了所有 java 包。 Do I need some installed?我需要安装一些吗? I was able to get this successful at some point but can't get back to it on a clean machine.我能够在某个时候获得成功,但无法在干净的机器上恢复。 Thanks in advance.提前致谢。

Parsing out/target/product/arm64/obj/ETC/sepolicy_neverallows_intermediates/plat_pub_policy.cil
Parsing out/target/product/arm64/obj/ETC/vendor_sepolicy.cil_intermediates/vendor_policy_raw.cil
[ 83% 63419/76082] Target cache fs image: out/target/product/arm64/cache.img
WARNING: out/target/product/arm64/cache.img approaching size limit (69206016 now; limit 69206016)
[ 85% 64672/75715] build out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/classes.dex
FAILED: out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/classes.dex 
/bin/bash -c "(rm -rf out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/ ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/ ) && (find out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex/ -maxdepth 1 -name \"classes*.dex\" | sort | xargs -I{} cp -f {} out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/ ) && (find out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/dex-hiddenapi/ -name \"classes*.dex\" | sort | sed 's/^/--dex=/' | xargs out/host/linux-x86/bin/hiddenapi --light-greylist=out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt )"
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] No DEX files specified
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] Command: out/host/linux-x86/bin/hiddenapi --light-greylist=out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] Usage: hiddenapi [options]...
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] 
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]   --dex=<filename>: specify dex file whose members' access flags are to be set.
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]       At least one --dex parameter must be specified.
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] 
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]   --light-greylist=<filename>:
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]   --dark-greylist=<filename>:
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]   --blacklist=<filename>: text files with signatures of methods/fields to be marked
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]       greylisted/blacklisted respectively. At least one list must be provided.
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] 
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]   --print-hidden-api: dump a list of marked methods/fields to the standard output.
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47]       There is no indication which API category they belong to.
hiddenapi E 11-08 12:34:51 29841 29841 hiddenapi.cc:47] 
[ 85% 64679/75707] //libcore:core-oj d8 [common]
ninja: build stopped: subcommand failed.
12:35:01 ninja failed with: exit status 1

#### failed to build some targets (02:49:08 (hh:mm:ss)) ####

sburke@sburke-xps:~/sandbox/a/pie$ java --version 
openjdk 9
OpenJDK Runtime Environment (build 9+181-android4627429)
OpenJDK 64-Bit Server VM (build 9+181-android4627429, mixed mode)
sburke@sburke-xps:~/sandbox/a/pie$ which java 
/home/sburke/sandbox/a/pie/prebuilts/jdk/jdk9/linux-x86/bin/java

I found the information on the XDA forum that this issue can be fixed just after restarting the build: https://forum.xda-developers.com/t/xperia-open-project-and-gapps-help-wanted.3870751/#post-78284912我在 XDA 论坛上找到的信息说这个问题可以在重新启动构建后修复: https : //forum.xda-developers.com/t/xperia-open-project-and-gapps-help-wanted.3870751/ #post-78284912

It didn't help me, yet I was able to overcome the problem on Ubuntu 20.04 LTS by going step by step, ie clean the module which fails, then build only this particular module:它没有帮助我,但我能够通过逐步解决 Ubuntu 20.04 LTS 上的问题,即清理失败的模块,然后仅构建此特定模块:

$ make clean-apache-xml
$ make apache-xml

After that, I got the same issue with another module - ims-common.在那之后,我在另一个模块 - ims-common 上遇到了同样的问题。 I did the same to this package and after that apache-xml was built successfully and I was able to finish the AOSP build:我对这个包做了同样的事情,在成功构建 apache-xml 之后,我能够完成 AOSP 构建:

$ make clean-ims-common
$ make ims-common
$ make apache-xml
$ make -j12

I had the same issue while building LineageOS 16 (based on Android 9) on Ubuntu 20.04 LTS.我在 Ubuntu 20.04 LTS 上构建 LineageOS 16(基于 Android 9)时遇到了同样的问题。

I can confirm that Anton's solution works also in this case.我可以确认安东的解决方案在这种情况下也有效。 Moreover I use my build on a daily basis and I haven't found any issues.此外,我每天都使用我的构建,我没有发现任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM