background image

Android 

 

 编译错误处理

 

 

(2012-09-27 17:16)

标签

:  

今天

  

a

  

Android

  

color

  

开发

  

 

分类:

Android

Initializing a Build Environment
今天在新开发环境里编译 ICS,发现错误很多

/usr/bin/ld: cannot find -lz

/usr/bin/ld: cannot find -lncursesw

/bin/bash: bison: command not found

/usr/bin/ld: cannot find -luuid

............好多啊

在 google 官网上找到了答案,在不同的开发环境中,需要安装对应的包,ubuntu10,12 需要安装的
包一次性搞定。

官网地址:http://source.android.com/source/initializing.html

Setting up a Linux build environment 

These instructions apply to all branches, including master.
The Android build is routinely tested in house on recent versions of Ubuntu 
LTS   (10.04),   but   most   distributions   should   have   the   required   build   tools 
available. Reports of successes or failures on other distributions are welcome.
For Gingerbread (2.3.x) and newer versions, including the master branch, a 
64-bit   environment   is   required.   Older   versions   can   be   compiled   on   32-bit 
systems.
Note:   It   is   also   possible   to   build   Android   in   a   virtual   machine.   If   you   are 
running Linux in a virtual machine, you will need at least 16GB of RAM/swap  
and 30GB or more of disk space in order to build the Android tree.
Detailed instructions for Ubuntu and MacOS follow. In general you will need:
Python 2.5 -- 2.7, which you can download from 

python.org

.

GNU Make 3.81 -- 3.82, which you can download from 

gnu.org

,

JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You 
can download both from 

java.sun.com

.

Git 1.7 or newer. You can find it at 

git-scm.com

.

Installing the JDK 

The Sun JDK is no longer in Ubuntu's main package repository. In order to 
download it, you need to add the appropriate repository and indicate to the 
system which JDK should be used.
Java 6: for Gingerbread and newer

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" $ sudo apt-get 
update $ sudo apt-get install sun-java6-jdk 

Java 5: for Froyo and older