ANDROID编译过程的问题及解决



问题一:error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
 解决方法:ubuntu 强制安装 ia32-libs


1。切换到root权限


       sudo -i

2。进入apt源列表

      cd /etc/apt/sources.list.d

3。添加ubuntu 13.04的源,因为13.10的后续版本废弃了ia32-libs

 echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" > ia32-libs-raring.list



4。更新源并安装ia32-libs

      apt-get update

      apt-get install ia32-libs



5。恢复源

      rm ia32-libs-raring.list

      apt-get update
问题二:
1.jar、javadoc或者javah命令找不到

/bin/bash: jar: command not found
make: *** [out/host/common/obj/JAVA_LIBRARIES/antlr-runtime_intermediates/javalib.jar] Error 127
或者
/bin/bash: javah: command not found

Answer:
cd /usr/bin
sudo ln -s -f /usr/local/java/jdk1.6.0_45/bin/javah
sudo ln -s -f /usr/local/java/jdk1.6.0_45/bin/javadoc
sudo ln -s -f /usr/local/java/jdk1.6.0_45/bin/jar


2.[out/target/common/docs/api-stubs-timestamp] Error 45

Answer:
make clean
make


问题三: OSError: [Errno 2] No such file or directory

  这是由于没有安装git造成的,安装上git就可以了。按说程序里面应该判断一下系统是否安装了git,不知道为什么没有判断。
   sudo apt-get install git-core
  
  
问题四:
Question-1:
bison -d  -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127

Answer:
sudo apt-get install bison


Question-2:
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

Answer:
sudo apt-get install flex


Question-3:
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'

Answer:
sudo apt-get install gperf


Question-4:
/bin/bash: xmllint: command not found
Answer:
sudo apt-get  install libxml2-utils

Question-5:
make[1]: lzma: Command not found
Answer:
sudo apt-get  install lzma


Question-6:
g++: g++: selected multilib '32' not installed
selected multilib '32' not installed
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl] Error 1
make: *** Waiting for unfinished jobs....
make: *** [out/host/linux-x86/obj/lib/libESR_Portable.so] Error 1

Answer:
sudo apt-get install g++-4.4-multilib gcc-4.4-multilib


Question-7:
external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1

Answer:
sudo apt-get install zlib1g-dev


Question-8:
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

Answer:
sudo apt-get install lib32ncurses5-dev


Question-9:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/main-common.o] Error 1

Answer:
sudo apt-get install libx11-dev


     sudo apt-get install libc6-dev:i386
     sudo apt-get install build-essential
     sudo apt-get install gcc-multilib


sudo apt-get install xsltproc


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值