Build an Android Open Source Project (AOSP) failed with Soong error: Unrecognized property "protos"

Build an Android Open Source Project (AOSP) failed with Soong error: Unrecognized property "protos"

我正在尝试在 Ubuntu 20.04 上构建 AOSP。一切顺利,直到建立特定目标。我几乎在构建开始时遇到下一个错误:

timur@timur-H110M-HD2:~/WORKING_DIRECTORY$ make -j4
22:24:08 ************************************************************
22:24:08 You are building on a machine with 15.5GB of RAM
22:24:08 
22:24:08 The minimum required amount of free memory is around 16GB,
22:24:08 and even with that, some configurations may not work.
22:24:08 
22:24:08 If you run into segfaults or other errors, try reducing your
22:24:08 -j value.
22:24:08 ************************************************************
build/make/core/soong_config.mk:175: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.build/make/core/soong_config.mk:176: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=S
PLATFORM_VERSION=S
TARGET_PRODUCT=aosp_crosshatch
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.4.0-54-generic-x86_64-Ubuntu-20.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=AOSP.MASTER
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/google/crosshatch hardware/google/av hardware/google/camera hardware/google/inte
rfaces hardware/google/pixel hardware/qcom/sdm845 vendor/google/camera vendor/qcom/sdm845 vendor/google/interfac
es vendor/qcom/crosshatch/proprietary
============================================
[ 99% 206/208] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: external/crosvm/protos/Android.bp:22:11: unrecognized property "protos"
error: external/crosvm/protos/Android.bp:30:11: unrecognized property "protos"
22:24:44 soong bootstrap failed with: exit status 1

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

不明白问题出在哪里。请帮忙

尝试更新您的 AOSP 树中的 build/soong,因为它有一些关于 rust 的新变化,例如这个:https://android.googlesource.com/platform/build/soong/+/57f434e8582d4d2bdfa7b439141daf552cd6ea38

所以,我再次执行repo sync,问题就解决了。

$ repo sync
$ make clobber
$ source build/envsetup.sh
$ lunch
$ make -j8