转载说明:
最好是按照android官网的编译环境设置来操作。所以,下面转载的文章仅供参考。
我在ubuntu11.10上编译android4.0.3r1版本,也遭遇问题:
(3)/bin/bash: g++: command not found
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 127
解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install build-essential
另外,按照android官网的编译配置说明
http://source.android.com/source/initializing.html
,发现有些包装不上,譬如:
lib32ncurses5-dev
lib32readline5-dev
我是用ubuntu的soft center搜索curses 和 readline 安装了最相似的版本(可能没有32)。
ia32-libs
安装时无法找到,没有安装,不知道编译是否会出问题,正在编译中。。。
from:http://blog.163.com/yuyuer_007/blog/static/69133549201181474456812/
参见:http://blog.csdn.net/izard999/article/details/6699962;
Ubuntu10.10默认安装的纯净系统,没装任何其他软件。
1.下载源码android-2.2,直接make
2.出错及解决如下:
(1)/bin /bash: bison: command not found
解决:sudo apt-get install bison
(2)make: *** No rule to make target `Please-install-jdk-5.0',
我的ubuntu 默认的安装的为java6;
解决:安装JDK 5.0
参见 How to install sun-java5-jdk on Ubuntu 9.10 or Ubuntu 10.10
4): 执行 sudo apt-get update 更新源.
5): 配置编译环境并下载JDK5:sudo apt-get install sun-java5-jdk
(3)/bin/bash: g++: command not found
在应用程序->Ubuntu软件中心,选择安装g++;
(4)external/clearsilver/cgi/cgi.c:22:18: error: zlib.h: No such file or directory
解决:sudo apt-get install zlib1g-dev(5)/bin/bash: flex: command not found
解决:sudo apt-get install flex
(6)/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
解 决: sudo apt-get install libncurses-dev(7)prebuilt/linux-x86/sdl/include/SDL /SDL_syswm.h:55:22: error: X11/Xlib.h: No such file or directory
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:56:23: error: X11/Xatom.h: No such file or directory
In file included from external/qemu/android/skin/window.c:19:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:73: error: expected specifier-qualifier-list before ‘XEvent’
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:86: error: expected specifier-qualifier-list before ‘Display’
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/skin/window.o] Error 1
解决: sudo apt-get install libx11-dev
(8)sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'
解 决: sudo apt-get install gperf