Sl4yerJ3ns
Sl4yerJ3ns

Reputation: 1

Failed to build Android: soong bootstrap failed with exit status 1

At the moment, I am playing around with Android, figuring out how to build my own custom Android ROM, and everything seems to be going well. All until I start to compile Android.

When I enter make -j2 aapt into the terminal, after a little bit of time, stops with an error. This is the entire make process.

============================================
PLATFORM_VERSION_CODENAME=VanillaIceCream
PLATFORM_VERSION=VanillaIceCream
PRODUCT_INCLUDE_TAGS=com.android.mainline
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=generic
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.2.0-31-generic-x86_64-Ubuntu-22.04.3-LTS
HOST_CROSS_OS=windows
BUILD_ID=AOSP.MAIN
OUT_DIR=out
============================================
[ 33% 1/3] converting Android.bp files to BUILD files at out/soong/bp2build
FAILED: out/soong/bp2build_files_marker
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out
 "out"     --soong_variables out/soong/soong.aosp_arm.variables --bp2build_marker out/soong/bp2build_files_marker --globListDir bp2build_files --globFile out/soong/globs-bp2build_files.ninja -t -l out/.mo
dule_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.aosp_arm.bp2build_files Android.bp
error: external/llvm/Android.bp:66:1: unrecognized module type "llvm_defaults"
error: frameworks/compile/mclinker/tools/mcld/Android.bp:29:1: unrecognized module type "llvm_tblgen"
error: external/llvm/Android.bp:195:1: unrecognized module type "llvm_tblgen"
error: external/llvm/Android.bp:201:1: unrecognized module type "llvm_tblgen"
error: external/llvm/Android.bp:207:1: unrecognized module type "force_build_llvm_components_defaults"
error: external/clang/Android.bp:119:1: unrecognized module type "llvm_tblgen"
error: frameworks/compile/slang/Android.bp:163:1: unrecognized module type "llvm_tblgen"
fatal errors encountered
14:50:38 soong bootstrap failed with: exit status 1

#### failed to build some targets (4 seconds) ####

For more context, I'm running Ubuntu 22.04 on a 64 bit platform and have 32GB of RAM (which I am upgrading to 64 GB soon). Also, I'm building Android off of the main branch in AOSP.

For the record, I already tried a lot of suggestions I found on the internet, which mostly stated "get more RAM" or "use make -j2 aapt". None of these actually worked.

Upvotes: 0

Views: 1498

Answers (2)

satur9nine
satur9nine

Reputation: 15082

Check this answer regarding configuring ZRAM which should allow the build to succeed: Is it possible to build AOSP on 32GB RAM?

Also consider using a docker build environment that is already known to successfully build AOSP, see: Unable to compile AOSP source code on Ubuntu 24.04 system

Upvotes: 0

unsignedchar256
unsignedchar256

Reputation: 1

This depends on the LLVM you are using.

In my case, I was compiling Android-x86 (Pie) and I was using llvm90. So I had to replace everything with llvm90.

grep --recursive --extended-regexp "(llvm_defaults|llvm_tblgen|llvm-defaults|llvm-tblgen)" external/llvm/

Then replace each llvm based on the search match. In my case, I replaced everything containing llvm with llvm90.

You may also want to replace anything containing libLLVM if the problem still exists. Usually if you are using LLVM that is not provided by AOSP.

Upvotes: 0

Related Questions