# 初始repo仓库
repo init -u https://mirrors.bfsu.edu.cn/git/AOSP/platform/manifest -b android-9.0.0_r46 --partial-clone --clone-filter=blob:limit=10M
# 同步repo
cd.repo/repo
git pull
croot
repo sync -j16
# 下载bin驱动
https://developers.google.cn/android/drivers?hl=zh-cn#crosshatchpq3a.190801.002
# Android 9的编译环境是python2
sudo ln –s /usr/bin/python2 /usr/bin/python
# 在 ~/.bashrc 添加环境变量LC_ALL
# Android 9 aosp build need
export LC_ALL=C
source ~/.bashrc
# 需要重新编译flex
aosp/prebuilts/misc/linux-x86/flex/flex-2.5.39.source/install/bin/flex
./configure --prefix=`pwd`/install
# 将编译的`pwd`/install下的flex可执行文件拷贝到prebuilts/misc/linux-x86/flex/flex-2.5.39
# 替换成之前的flex-2.5.39
Copy flex to prebuilts/misc/linux-x86/flex/flex-2.5.39
target dex2oat: out/target/product/crosshatch/dex_bootjars/system
…..
patchoatd E 04-17 23:51:13 513244 513244 image_space.cc:1761] Could not create image space with image file 'out/target/product/crosshatch/dex_bootjars/system/framework/boot.art'. Attempting to fall back to imageless running. Error was: Failed to mmap at expected address, mapped at 0x7f4037800000 instead of 0x705db000
patchoatd E 04-17 23:51:13 513244 513244 image_space.cc:1761] Attempted image: out/target/product/crosshatch/dex_bootjars/system/framework/boot-framework.art
patchoatd E 04-17 23:51:13 513244 513244 runtime.cc:1290] Dex file fallback disabled, cannot continue without image.
patchoatd E 04-17 23:51:13 513244 513244 patchoat.cc:485] Unable to initialize runtime
https://groups.google.com/g/android-building/c/ZfUQQWt_ABI
https://android-review.googlesource.com/c/platform/art/+/2226578/