Ubuntu 18.04
Android P
repo init -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. I deleted all java packages before this build. 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
It didn't help me, yet I was able to overcome the problem on Ubuntu 20.04 LTS by going step by step, i.e. clean the module which fails, then build only this particular module:
$ make clean-apache-xml
$ make apache-xml
After that, I got the same issue with another module - 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:
$ 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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With