Ubuntu16.04 build android6.0

安装依赖

sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install lib32z-dev ccache
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386
sudo lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache

安装openJDK7

Ubuntu16.04的安装源已经默认没有OpenJDK7了,所以要自己手动添加仓库

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
速度很慢,如果系统自带openjdk8 通过下面命令切换
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
查看: java -version
build 7.0使用8
build 6.0 使用7

修改源码

a . 可以先不修改,build报错再修改。
错误为: recipe for target ' out/host/linux-x86/obj/lib/libart.so'failed.

b . 文件路径 /home/snake/workspace/bsp/art/build/Android.common_build.mk
搜索,把ART_HOST_CLANG := true注销
改为如下

ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),true)
 # By default, host builds use clang for better warnings.
 #ART_HOST_CLANG := true
endif

PS:google到的修改是把
ifneq ($(WITHOUT_HOST_CLANG),true)
改为
ifneq ($(WITHOUT_HOST_CLANG),fasle)
本人尝试无用。。。。

你可能感兴趣的:(Ubuntu16.04 build android6.0)