1. 用清华源下载最新版本
~/workspace/AOSP14$sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python3.8 libncurses5
~/workspace/AOSP14$sudo apt install libwxgtk3.2-dev
~/workspace/AOSP14$repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-14.0.0_r55 --depth=1
~/workspace/AOSP14$repo sync -j8
2. 编译
可能会遇到的问题:
~/workspace/AOSP14$source build/envsetup.sh
~/workspace/AOSP14$lunch sdk_car_x86_64-userdebug
Invalid lunch combo: sdk_car_x86_64-userdebug
Valid combos must be of the form <product>-<release>-<variant>
xxx@xxx-VMware-Virtual-Platform:~/workspace/AOSP14$ lunch
You're building on Linux
Warning: Cannot display lunch menu.
Note: You can invoke lunch with an explicit target:
usage: lunch [target]
Which would you like? [aosp_cf_x86_64_phone-trunk_staging-eng]
Pick from common choices above (e.g. 13) or specify your own (e.g. aosp_barbet-trunk_staging-eng):
这时,执行以下命令
~/workspace/AOSP14$:build_build_var_cache
21:54:45 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:136: error: No release config set for target; please set TARGET_RELEASE, or if building on the command line use 'lunch <target>-<release>-<build_type>', where release is one of: ap2a.
21:54:45 dumpvars failed with: exit status 1
~/workspace/AOSP14$export TARGET_RELEASE=ap2a
~/workspace/AOSP14$lunch
~/workspace/AOSP14$lunch aosp_oriole-ap2a-userdebug