2013年1月21日星期一

android源码编译

条件:
64位ubuntu11.10,硬盘40G(在虚拟机里面1G内存肯定不够用)


一般步骤:
基本流程按照Google官方的说明就ok:http://source.android.com/source/initializing.htmlhttp://source.android.com/source/downloading.html
第一个是初始化编译环境,下载相关的软件包,第二个才开始下载和编译。

下面是我编译4.1.2_r1成功的截图:(4.1.2_r1源码本身12G,最后一共用了30多G


特别说明:
1.JDK直接去orcle官网下载快多了,没必要用apt,用apt只是省去了设置环境变量的过程。
2.官方Installing required packages这一步中lib32readline5-dev改成6。
3.A new repo command ( 1.18) is available:

这个提示下面给了一行cp命令,执行了就ok了,不管这个升级提示好像也没事。
4.repo:command not found 执行下面两行就行了:
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc

export PATH=$PATH:$HOME/bin
5.下载repo脚本的时候可能下不动,添加这个到/etc/hosts应该可以了
          74.125.237.1   dl-ssl.google.com

6.过程中还会遇到下面的连接错误提示:(不需要管,只是连接不稳定而已)

①The requested URL returned error: 406 Not Acceptable while accessing    https://android.googlesource.com/platform/external/jmonkeyengine/info/refs
②Failed to connect to 2404:6800:4005:c00::52: Network is unreachable while accessing https://android.googlesource.com/platform/external/jmonkeyengine/info/refs

7.停在Fetching projects: 100% (293/293), done.  
原因不知道,反正已经下载完了,接下来就是check out的过程。手动就行了。
命令:repo sync -l
l是local,用repo sync -h可以查看repo sync可以用哪些参数.

8.在Syncing work tree过程中,我遇到这个Error:
error: external/apache-http/: platform/external/apache-http checkout
类似 error: external/*/: platform/external/* checkout
其实应该只是同步的过程中代码被修改了,把/external/apache-http/删除了,重新repo sync一次就可以了。


没有评论:

发表评论