Android14编译

914 阅读1分钟

在以往的AOSP源码中,我们通常使用 source build/envsetup.sh命令初始化环境后,接着通过 lunch xxx选择需要编译平台

但是在AOSP14的源码上,通过以往的编译命令机进行编译时,会出现以下报错。

23:32:01 Build sandboxing disabled due to nsjail error.
In file included from build/make/core/config.mk:380:
In file included from build/make/core/envsetup.mk:51:
build/make/core/release_config.mk:145: error: No release config found for TARGET_RELEASE: xxx(与自己编译命令相关). Available releases are: ap2

根据链接xdaforums.com/t/lunch-fai… 中xda大佬的描述:

Figure out which device you're building for (e.g., generic image, Pixel 8..).
Check the COMMON_LUNCH_CHOICES in its product makefile.
Use the lunch command with:
The product name (e.g., aosp_arm64)
The correct release (e.g., ap1a or ap2a)
The build variant (e.g., eng, userdebug, user)

加入我们想编译基于arm64的cuttlefish镜像,我们初始化环境之后,需要执行 lunch aosp_cf_arm64_phone-ap2a-eng,然后执行m命令进行编译,等待一段时间后,源码开始了编译:

image.png