ubuntu14.10上编译Android5.0.2源码

2015年04月14日 Android 3条评论 阅读22533次

ubuntu14.10上编译Android5.0.2源码

前面一篇文章说到了ubuntu14.10上Android5.0.2源码下载的具体步骤,这篇文章说的是ubuntu14.10上编译Android5.0.2源码的那些事。

1.先安装jdk

这里我使用的是openjdk,网上很多人关于jdk到底使用jdk5、jdk6、jdk7还是openjdk一直在争论不休,我选择的是openjdk7,最终证明是可以编译通过的。

sudo apt-get install openjdk-7-jdk

安装好后,设置环境变量:

sudo gedit/etc/profile

 文件末尾加上

 JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/  

 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

 export JAVA_HOME  

 export PATH

2.安装ccache

 sudo apt-get install ccache

 source ~/.bashrc

3.安装其他依赖的软件

勿必提前安装好,否则编译时出错,会浪费N多时间。

sudo apt-get install git-core

sudo apt-get install git

sudo apt-get install gnupg

sudo apt-get install flex

sudo apt-get install bison

sudo apt-get install gperf

sudo apt-get install build-essential

sudo apt-get install zip

sudo apt-get install curl

sudo apt-get install libc6-dev

sudo apt-get install libncurses5-dev:i386

sudo apt-get install x11proto-core-dev

sudo apt-get install libx11-dev:i386

sudo apt-get install libreadline6-dev:i386

sudo apt-get install libgl1-mesa-dev

sudo apt-get install g++-multilib

sudo apt-get install mingw32

sudo apt-get install tofrodos

sudo apt-get install python-markdown

sudo apt-get install libxml2-utils

sudo apt-get install xsltproc

sudo apt-get install zlib1g-dev:i386

sudo apt-get install dpkg-dev

4.下载其他硬件驱动

到这里,依赖软件基本完成,剩下的就根据自己的需求,下载其他硬件驱动了,我是用编译Nexus6的系统image镜像,所以还需要下载Nexus6的硬件驱动,详细可参照这篇文章。

http://jileniao.net/post-154.html

5.进入到源码目录

  cd android  

  prebuilts/misc/linux-x86/ccache/ccache -M 50G

6.加载环境变量

. build/envsetup.sh

7.选择lunch选项

 lunch

根据测试机器Nexus6,也就是shamu,所以我选择的是21

8.开始编译

make

最终编译完成,我耗时11小时48分钟。

Image

host C++: liblatinime_host_static_for_unittests_32 <= packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp

host C++: liblatinime_host_static_for_unittests_32 <= packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp

host C++: liblatinime_host_static_for_unittests_32 <= packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp

host C++: liblatinime_host_static_for_unittests_32 <= packages/inputmethods/LatinIME/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp

host StaticLib: liblatinime_host_static_for_unittests_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/liblatinime_host_static_for_unittests_intermediates/liblatinime_host_static_for_unittests.a)

Export includes file: packages/inputmethods/LatinIME/native/jni/HostUnitTests.mk -- out/host/linux-x86/obj32/EXECUTABLES/liblatinime_host_unittests_intermediates/export_includes

host Executable: liblatinime_host_unittests (out/host/linux-x86/obj32/EXECUTABLES/liblatinime_host_unittests_intermediates/liblatinime_host_unittests)

#### make completed successfully (11:48:27 (hh:mm:ss)) ####


编译中我遇到了编译到libwebviewchromium.so时停止很长时间最后发生错误的问题,解决方法请参照下面这篇文章。

http://jileniao.net/ubunt-add-swap-to-build-libwebviewchromium.html


至此,文末。。。。

分享本文至:

WRITTEN BY

avatar
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

3 条评论

  1. avatar sadnauka

    <a href="http://www.clixorads.com/asics-gel-lyte-5-dark-blau-zone-scarpee">asics gel lyte 5 dark blau zone</a> <a href="http://www.officelucust.com/nike-internationalist-hvit-metallic-s%C3%B8lv-runningg">nike internationalist hvit metallic s酶lv</a> <a href="http://www.ibigwig.com/air-jordan-retro-9-schwarz-gold-schuhei">air jordan retro 9 schwarz gold</a> <a href="http://www.jaypelle.com/pittsburgh-penguins-new-era-snapback-hath">pittsburgh penguins new era snapback</a> <a href="http://www.sblpodcast.com/air-jordan-retro-5-royal-blu-maschiota-verde-trainersce">air jordan retro 5 royal blu maschiota verde</a> <a href="http://www.prmadvantage.com/adidas-protator-lz-trx-fg-2014-schuhek">adidas protator lz trx fg 2014</a>
    sadnauka http://www.sadnauka.com/

  2. avatar freerivalcasinos

    <a href="http://www.sundialproductions.net/nike-air-max-2015-femminile-rosso-argento-chaussuresa">nike air max 2015 femminile rosso argento</a> <a href="http://www.survivewatercrisis.net/nike-zoom-winflo-3-grau-laufen-schuhe-online-obuva">nike zoom winflo 3 grau laufen schuhe online</a> <a href="http://www.szczybelski.net/nike-free-hyperfeel-femminile-in-esecuzione-scarpe-butyc">nike free hyperfeel femminile in esecuzione scarpe</a> <a href="http://www.tammyjdalton.net/bianca-and-grigio-jordan-8-scarpeb">bianca and grigio jordan 8</a> <a href="http://www.tastingtheacorn.net/nike-free-5.0-femminile-scarpe-pelle-nero-bianca-kurpesf">nike free 5.0 femminile scarpe pelle nero bianca</a> <a href="http://www.technologyhandyman.net/asics-l%C3%B8ping-sko-oransje-scarpea">asics l酶ping sko oransje</a>
    [url=http://www.freerivalcasinos.net/]freerivalcasinos[/url]

  3. avatar beachtimenow

    <a href="http://www.iofficeadmin.com/gold-hermes-belt-hermesr">gold hermes belt</a> <a href="http://www.scarystate.com/nike-air-force-1-puerto-rico-sko-shoesv">nike air force 1 puerto rico sko</a> <a href="http://www.emtekmakina.com/coach-tote-ipad-pen-coache">coach tote ipad pen</a> <a href="http://www.solidgoldpay.com/bon-march%C3%A9-adidas-damian-lillard-hommes-bleu-shoesa">bon march茅 adidas damian lillard hommes bleu</a> <a href="http://www.sobresazucar.com/nike-air-jordan-8-aqua-skos">nike air jordan 8 aqua</a> <a href="http://www.zarabahmani.com/ferragamo-logo-belt-beltr">ferragamo logo belt</a>
    beachtimenow http://www.beachtimenow.com/

欢迎留言




用户登录

sitemap