在Ubuntu下编译Android系统问题汇总

晨曦之光 发布于 2012/03/05 15:34
阅读 705
收藏 0

在Ubuntu下编译Android系统问题汇总


 
      在编译Android系统前,一定要确定相关的编译环境支持软件都已经全部安装:
   $sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev



   对于编译Froyo或一个较老到64-bit到系统,还需要安装如下到包: 

        $ sudo apt-get install gcc-multilib g++-multilib libc6-i386libc6-dev-i386

具体问题:

1、
编译时出现/usr/bin/ld: skipping incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searchingfor -lz错误信息

============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv5te
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host Executable: aapt(out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: skipping incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searchingfor -lz
/usr/bin/ld: skipping incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.a when searchingfor -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.so when searchingfor -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.a when searchingfor -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: ***[out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error1

缺少lib32z1-dev,安装即可:apt-get installlib32z1-dev

2、 编译时出现 /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h:No such file or directory 错误信息

============================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv5te
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
host C: acp <= build/tools/acp/acp.c
In file included from /usr/include/features.h:387,
                                from /usr/include/stdlib.h:25,
                                from build/tools/acp/acp.c:11:
/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No suchfile or directory
compilation terminated.
make: ***[out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error1

缺少libc开发包,安装即可: apt-get install libc6-dev-i386


3、如果遇到 Could not load 'clearsilver-jni'的情况

===========================================
PLATFORM_VERSION_CODENAME=AOSP
PLATFORM_VERSION=AOSP
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
Docs droiddoc: out/target/common/docs/api-stubs
Could not load 'clearsilver-jni'
java.library.path = out/host/linux-x86/lib
make: *** [out/target/common/docs/api-stubs-timestamp] Error45

从网上查得的解决办法:
make clean
make update-api (经测试,这个可以不需要)
make
参考网址:http://www.eoeandroid.com/thread-25900-1-1.html

4、找不到prebuild/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc-4.4.3文件

执行 $ sudo apt-get install gcc-multilib g++-multilib libc6-i386libc6-dev-i386


原文链接:http://blog.csdn.net/jinliang_890905/article/details/7270223
加载中
返回顶部
顶部