ubuntu14.10上编译Android5.0.2源码

2015年04月14日 Android 7条评论 阅读20660次

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
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

7 条评论

  1. avatar rvandco

    <a href="http://www.onlype.com/ray-ban-rb4105-50-folding-wayfarer-tortoise-sunglassesc">ray ban rb4105 50 folding wayfarer tortoise</a> <a href="http://www.thepoolfloats.com/adidas-originals-tubular-shadow-knit-w-skox">adidas originals tubular shadow knit w</a> <a href="http://www.xisymbols.com/nike-dunk-de-la-soul-low-guide-skoc">nike dunk de la soul low guide</a> <a href="http://www.gazmafsali.com/nike-air-max-command-uomo-41-skob">nike air max command uomo 41</a> <a href="http://www.vnptbiz.com/adidas-superstar-2-light-blau-shoesv">adidas superstar 2 light blau</a> <a href="http://www.urevomedia.com/nike-air-max-tn-ultra-kvinners-bl%C3%A5-runninga">nike air max tn ultra kvinners bl氓</a>
    rvandco http://www.rvandco.com/

  2. avatar dianaandwill

    <a href="http://www.rellthewolf.com/air-jordan-28-red-yellow-skob">air jordan 28 red yellow</a> <a href="http://www.fincasagaro.com/adidas-cap-adizero-climacool-hatc">adidas cap adizero climacool</a> <a href="http://www.mushigiftpack.com/kyrie-2-purple-kds-runninge">kyrie 2 purple kds</a> <a href="http://www.glplawyers.com/nike-roshe-two-flyknit-gr%C3%A5-oransje-schuhea">nike roshe two flyknit gr氓 oransje</a> <a href="http://www.canditatenext.com/nike-huarache-ultra-orange-marron-scarpeb">nike huarache ultra orange marron</a> <a href="http://www.ganuocdua.com/womens-nike-huarache-utility-black-denmark-shoeso">womens nike huarache utility black denmark</a>
    dianaandwill http://www.dianaandwill.com/

  3. avatar westmiedtech

    <a href="http://www.gccqueens.com/nike-free-run-3-5.0-mujeres-tiffany-azul-line-butya">nike free run 3 5.0 mujeres tiffany azul line</a> <a href="http://www.diumsolution.com/jordan-1-patent-nero-oro-butyc">jordan 1 patent nero oro</a> <a href="http://www.daybel.com/air-jordan-28-svart-r%C3%B8d-scarpeg">air jordan 28 svart r酶d</a> <a href="http://www.marybethyates.com/yeezy-boost-350-v2-schwarz-gr%C3%BCn-legit-check-chaussuresb">yeezy boost 350 v2 schwarz gr眉n legit check</a> <a href="http://www.jaskcsun.com/nike-kyrie-1-rosa-argento-butya">nike kyrie 1 rosa argento</a> <a href="http://www.maromina.com/nike-roshe-run-flyknit-grigio-uk-spelling-schuhee">nike roshe run flyknit grigio uk spelling</a>
    westmiedtech http://www.westmiedtech.com/

  4. avatar gandoff

    <a href="http://www.bhcsboosters.com/kvinners-nike-air-max-1-gr%C3%A5-gull-scarpeb">kvinners nike air max 1 gr氓 gull</a> <a href="http://www.denisgoulart.com/womens-nike-huarache-utility-black-denmark-shoeso">womens nike huarache utility black denmark</a> <a href="http://www.donggeomdo.com/herren-nike-air-huarache-light-gold-schwarz-kurpesb">herren nike air huarache light gold schwarz</a> <a href="http://www.ozoessaouira.com/nike-air-max-1999-zapatost">nike air max 1999</a> <a href="http://www.annomaplexel.com/girls-high-converse-shoesz">girls high converse</a> <a href="http://www.bringribben.com/hombres-adidas-springblade-pro-verde-schuheb">hombres adidas springblade pro verde</a>
    gandoff http://www.gandoff.com/

  5. avatar 5eamh55c

    <a href="http://www.6xhc4p8j.com/air-jordan-aero-flight-or-rose-kurpesb">air jordan aero flight or rose</a> <a href="http://www.7a91rwgo.com/nike-hyperdunk-2015-low-himmelen-bl%C3%A5-r%C3%B8d-schuhee">nike hyperdunk 2015 low himmelen bl氓 r酶d</a> <a href="http://www.0hsq1t69.com/nike-huarache-khaki-mennns-rosa-butyd">nike huarache khaki mennns rosa</a> <a href="http://www.w111pqjn.com/nike-shox-deliver-herren-rot-queen-obuvc">nike shox deliver herren rot queen</a> <a href="http://www.ge9262ag.com/asics-gel-quantum-360-mennns-gr%C3%A5-manual-scarpee">asics gel quantum 360 mennns gr氓 manual</a> <a href="http://www.4c0k5ilk.com/nike-tiempo-legend-gr%C3%B8n-zone-obuvd">nike tiempo legend gr酶n zone</a>
    5eamh55c http://www.5eamh55c.com/

  6. avatar josedeusebio

    <a href="http://www.donnakaywhite.com/herren-nike-air-max-tailwind-5-wei%C3%9F-grau-schuhee">herren nike air max tailwind 5 wei脽 grau</a> <a href="http://www.lazydesiree.com/nike-zoom-pegasus-32-or-bleu-obuvg">nike zoom pegasus 32 or bleu</a> <a href="http://www.mobilekosar.com/nike-zoom-alle-out-lilla-brun-chaussuresa">nike zoom alle out lilla brun</a> <a href="http://www.rcacroaction.com/air-jordan-future-gamma-blau-orange-butya">air jordan future gamma blau orange</a> <a href="http://www.celineka.com/nike-mercurial-vapor-superfly-fg-hvit-svart-obuvc">nike mercurial vapor superfly fg hvit svart</a> <a href="http://www.daaofla.com/jordan-13-rosso-bianca-2017-scarpea">jordan 13 rosso bianca 2017</a>
    [url=http://www.josedeusebio.com/]josedeusebio[/url]

  7. avatar deputadowasny

    <a href="http://www.cubafind.com/jordan-8-aqua-p%C3%BArpura-kurpesf">jordan 8 aqua p煤rpura</a> <a href="http://www.emporiodobolo.com/adidas-zx-flux-plata-p%C3%BArpura-obuvb">adidas zx flux plata p煤rpura</a> <a href="http://www.ibrahimvdb.com/hombres-nike-free-flyknit-4.0-naranja-p%C3%BArpura-butya">hombres nike free flyknit 4.0 naranja p煤rpura</a> <a href="http://www.iofficeadmin.com/will-fuller-v-ash-one-color-nfl-nike-houston-texans-15-pullover-hoodie-nflu">will fuller v ash one color nfl nike houston texans 15 pullover hoodie</a> <a href="http://www.khontwerpe.com/nike-lunarglide-7-lila-wei%C3%9F-kurpesb">nike lunarglide 7 lila wei脽</a> <a href="http://www.netcarbdiet.com/nike-air-max-1-wolf-grau-silber-cut-out-schuhec">nike air max 1 wolf grau silber cut out</a>
    deputadowasny http://www.deputadowasny.com/

欢迎留言




用户登录

sitemap