Android 11 编译报错收集

Aosp 11 编译报错收集

2021-09-20 zhuhongxi


一、构建编译环境过程

二、编译过程

1. 无法安装libesd0-dev

解决办法:
sudo vim /etc/apt/sources.list  //在行尾添加如下两行的内容

deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe

更新软件源并重新安装:

sudo apt-get update && sudo apt-get install libesd0-dev

2. libncurses.so.5缺少

FAILED: out/target/product/generic_x86_64/obj/RENDERSCRIPT_BITCODE/libclcore.bc_intermediates/rs_element.bc
/bin/bash -c "PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-3289846/bin/clang -Iframeworks/rs/script_api/include -Iexternal/clang/lib/Headers -MD -DRS_VERSION=24 -std=c99 -c -O3 -fno-builtin -e
mit-llvm -target renderscript64-linux-android -fsigned-char -D__x86_64__ -Wno-deprecated -Werror  -Werror -Wall -Wextra -Iframeworks/rs/cpu_ref -DRS_DECLARE_EXPIRED_APIS  -x renderscript frameworks/rs/dr
iver/runtime/rs_element.c -o out/target/product/generic_x86_64/obj/RENDERSCRIPT_BITCODE/libclcore.bc_intermediates/rs_element.bc"
prebuilts/clang/host/linux-x86/clang-3289846/bin/clang.real: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
00:04:04 ninja failed with: exit status 1

#### failed to build some targets (11:42 (mm:ss)) ####

解决方法:
sudo apt install apt-file
sudo apt-file update
sudo apt-file find libncurses.so.5
sudo apt install libncurses5

三、启动模拟器

1. 缺少文件userdata-qemu.img

emulator: Android emulator version 30.7.4.0 (build_id 7479360) (CL:N/A)
emulator: WARNING: encryption is off
handleCpuAcceleration: feature check for hvf
cannot add library /root/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /root/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
emulator: ERROR: VkCommonOperations.cpp:537: Failed to create Vulkan instance.
qemu-system-x86_64: Could not open '/root/aosp/out/target/product/generic_x86_64/userdata-qemu.img': No such file or directory

解决方法:
source build/envsetup.sh
lunch sdk_phone_x86_64
make -jx
emulator

你可能感兴趣的:(Android,Framework,android,ubuntu,linux)