最近无事,编译了一下android 5.0的源码。
首先,感谢前人的栽树,主要是参考了http://blog.youkuaiyun.com/chouretang/article/details/43769839这篇文章,在此谢过。本文使用的是Ubuntu15.10 。
不过中间还是遇到了一些问题,列举如下:
1、原文中
3.安装编译依赖的软件
要修改为以下的,原文应该是作者编辑问题,有多余的空格导致错误。
sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dri:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 dpkg-dev
2、编译过程中可能会遇到以下错误,使用make update-api进行编译即可
******************************
You have tried to change the API from what has been previously approved.To make these errors go away, you have two choices:
1) You can add "@hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
3、编译模拟器
选择版本
4、启动模拟器
参考http://jingyan.baidu.com/article/86112f13549b44273797872c.html 即可
发一张成功的截图