[Android Q&A, Help & Troubleshooting] naganddevelop:
Newbie to android build. Wanted to build an image for my device (Pie) . started testing / building one for marlin (Lunch aosp_marlin-userdebug). The buid repeatedly fails at 96%. Need help. Environment has been setup on a virtual machine in hyper V environment (24GB Ram, AMD Phenom II 1100T,OS-150GB,100GB Swap,AND Build -300 GB- Complete hardware info at the end.

. bashrc modifications

export OUT_DIR_COMMON_BASE=/and/out

export PATH=$PATH:/and:/and/bin:/and/out:/and/aosp_PPR2_181005_003

export USE_CCACHE=1

export LC_ALL=C

export ANDROID_JACK_VM_ARGS="-Xmx8192m -Xms512m -Dfile.encoding=UTF-8 -XX:+TieredCompilation"

Error Messages

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

[ 96% 85735/89212] target Strip (mini debug info): mdnsd (.../product/marlin/obj/EXECUTABLES/mdnsd_intermediates/mdnsd)

prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-nm: /and/out/aosp_PPR2_181005_003/target/product/marlin/symbols/system/bin/mdnsd: no symbols

[ 96% 85765/89212] //frameworks/native/services/surfaceflinger:libsurfaceflinger link libsurfaceflinger.so [arm]

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

[ 96% 85963/89212] Target boot image from recovery: /and/out/aosp_PPR2_181005_003/target/product/marlin/boot.img

cp: cannot stat ‘/and/out/aosp_PPR2_181005_003/target/product/marlin/root/init.recovery.*.rc’: No such file or directory

[ 96% 86223/89212] //art/runtime:libart link libart.so

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

[ 96% 86374/89212] Hidden API: /and/out/aosp_PPR2_181005_0...JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar

FAILED: /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar

/bin/bash -c "(rm -f /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar ) && (cp "/and/out/aosp_PPR2_181005_003/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar" "/and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar" ) && (rm -rf /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (mkdir -p /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (unzip -q /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar 'classes*.dex' -d /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (find /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -name "classes*.dex" | sort | sed 's/^/--dex=/' | xargs /and/out/aosp_PPR2_181005_003/host/linux-x86/bin/hiddenapi --light-greylist=/and/out/aosp_PPR2_181005_003/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt --dark-greylist=/and/out/aosp_PPR2_181005_003/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt --blacklist=/and/out/aosp_PPR2_181005_003/target/common/obj/PACKAGING/hiddenapi-blacklist.txt ) && (/and/out/aosp_PPR2_181005_003/soong/host/linux-x86/bin/soong_zip -o /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -C /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi -D /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi ) && (/and/out/aosp_PPR2_181005_003/soong/host/linux-x86/bin/merge_zips -D -zipToNotStrip /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar -stripFile "classes*.dex" /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar /and/out/aosp_PPR2_181005_003/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/dex-hiddenapi/classes.dex.jar /and/out/aosp_PPR2_181005_003/soong/.intermediates/frameworks/base/test-base/android.test.base/android_common/dex/android.test.base.jar )"

xargs: /and/out/aosp_PPR2_181005_003/host/linux-x86/bin/hiddenapi: terminated by signal 4

[ 96% 86377/89212] //art/runtime:libart link libart.so [arm]

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

[ 96% 86378/89212] //frameworks/base/libs/hwui:libhwui link libhwui.so

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

[ 96% 86379/89212] //frameworks/base/libs/hwui:libhwui link libhwui.so [arm]

Warning: request a ThreadPool with 1 threads, but LLVM_ENABLE_THREADS has been turned off

ninja: build stopped: subcommand failed.

06:43:46 ninja failed with: exit status 1

#### failed to build some targets (03:06:36 (hh:mm:ss)) ###