Ubuntu18.04 编译 Android10.0 系统环境,每次搞一个新电脑或环境,编译总要搞半天,虽然知道是环境安装的问题,但确实很烦和耗时,关键是报错各异。

思路: 网上找资料,首先要对齐Ubuntu 版本号,18.04, 20.04等,这个很关键,否则对不上。

最近弄的18.04,kernel都编译正常,一编译Android就挂了,啥错误提示都看不到,找了好多网页,总是好了。用最笨的办法解决。

sudo apt-get install git 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-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev python
sudo apt-get install lib32ncurses5 lib32z1 libc6:i386 libstdc++6:i386

下面这个测试有效果,安装后,一定sudo apt-get update  sudo apt-get uprade
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig kpartx python-mako gcc-arm-linux-gnueabihf libssl-dev

Log:  让人抓狂的log

ninja: no work to do.
[100% 1/1] 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
audioflinger init start
init start
audioflinger_DefaultsFactory
audioflinger_defaults
envDefault key: TARGET_BUILD_VARIANT
envDefault ret: userdebug
TARGET_BUILD_VARIANT: userdebug
hardware gatekeeper
sdkVersion: 29
USE_AUDIO_WHALE_HAL: false
envDefault key: TARGET_CAMERA_SENSOR_CCT
envDefault ret: 
TARGET_CAMERA_SENSOR_CCT: null
envDefault key: PRODUCT_PACKAGES
envDefault ret: 
PRODUCT_PACKAGES: null
envDefault key: TARGET_CAMERA_SENSOR_TOF
envDefault ret: 
TARGET_CAMERA_SENSOR_TOF: null
TARGET_BOARD_SENSOR_OV4C2: false
BOARD_FEATUREPHONE_CONFIG: false
audioflinger_DefaultsFactory
Killed
17:42:20 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.

将Ubuntu Shell环境修改为bash

执行sudo dpkg-reconfigure dash,选择No,将Ubuntu shell由dash修改为bash

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐