在尝试构建 AOSP 14 时,我在构建过程中遇到了错误。按照AOSP 14的要求配置了构建环境,但是遇到了如下错误:
internal error: undefined variable CTS_TEST_SUITES_DEFAULT
11:02:32 fatal errors encountered
#### failed to build some targets (02:25 (mm:ss)) ####
环境设置:
source build/envsetup.sh
。lunch aosp_cf_x86_64_phone-trunk_staging-userdebug
选择构建环境。构建信息:
PLATFORM_VERSION_CODENAME=VanillaIceCream
TARGET_PRODUCT=aosp_cf_x86_64_phone
TARGET_BUILD_VARIANT=userdebug
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-150-generic-x86_64-Ubuntu-18.04.6-LTS
BUILD_ID=MAIN
内存警告:
internal error: undefined variable CTS_TEST_SUITES_DEFAULT
thanhchung@Chung-Computer:/media/thanhchung/data/AOSP14$ source build/envsetup.sh
thanhchung@Chung-Computer:/media/thanhchung/data/AOSP14$ lunch aosp_cf_x86_64_phone-trunk_staging-userdebug
============================================
PLATFORM_VERSION_CODENAME=VanillaIceCream
PLATFORM_VERSION=VanillaIceCream
TARGET_PRODUCT=aosp_cf_x86_64_phone
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=silvermont
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=silvermont
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-150-generic-x86_64-Ubuntu-18.04.6-LTS
HOST_CROSS_OS=windows
BUILD_ID=MAIN
OUT_DIR=out
============================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wondering whether to use user, userdebug or eng?
user The builds that ship to users. Reduced debugability.
userdebug High fidelity to user builds but with some debugging options
enabled. Best suited for performance testing or day-to-day use
with debugging enabled.
eng More debugging options enabled and faster build times, but
runtime performance tradeoffs. Best suited for day-to-day
local development when not doing performance testing.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thanhchung@Chung-Computer:/media/thanhchung/data/AOSP14$ echo "$TARGET_PRODUCT-$TARGET_RELEASE-$TARGET_BUILD_VARIANT"
aosp_cf_x86_64_phone-trunk_staging-userdebug
thanhchung@Chung-Computer:/media/thanhchung/data/AOSP14$ m
11:00:10 ************************************************************
11:00:10 You are building on a machine with 15.6GB of RAM
11:00:10
11:00:10 The minimum required amount of free memory is around 16GB,
11:00:10 and even with that, some configurations may not work.
11:00:10
11:00:10 If you run into segfaults or other errors, try reducing your
11:00:10 -j value.
11:00:10 ************************************************************
============================================
PLATFORM_VERSION_CODENAME=VanillaIceCream
PLATFORM_VERSION=VanillaIceCream
TARGET_PRODUCT=aosp_cf_x86_64_phone
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=silvermont
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=silvermont
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-150-generic-x86_64-Ubuntu-18.04.6-LTS
HOST_CROSS_OS=windows
BUILD_ID=MAIN
OUT_DIR=out
============================================
internal error: undefined variable CTS_TEST_SUITES_DEFAULT
11:02:32 fatal errors encountered
#### failed to build some targets (02:25 (mm:ss)) ####
thanhchung@Chung-Computer:/media/thanhchung/data/AOSP14$
错误看起来很明显 - 您需要至少 64GB RAM 来构建 AOSP AOSP 构建要求