最新ubuntu12.04编译android2.2源码常见错误

1.
/bin/bash: bison: command not found Checking build tools versions…
解决方案:
sudo apt-get install bison
2.
You are attempting to build with the incorrect version of java.
Your version is: /bin/bash: java: command not found.
The correct version is: 1.5.
解决方案:
3.
/bin/bash: g++: command not found
解决方案:
sudo apt-get install g++
4.
external/clearsilver/cgi/cgi.c:22:18: fatal error: zlib.h: No such file or directory
解决方案:
sudo apt-get install zlib1g-dev
5.
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
解决方案:
打开Android.mk
$ gedit frameworks/base/libs/utils/Android.mk

6.
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:27: undefined reference to `pthread_getspecific’
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set’:
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create’
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific’
解决方案:
打开 frameworks/base/tools/aapt/Android.mk

7.
/bin/bash: flex: command not found
解决方案:
sudo apt-get install flex
8.
host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)
/usr/bin/ld: cannot find -lncurses
解决方案:
sudo apt-get install libncurses5-dev
9.
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get’:
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:27: undefined reference to `pthread_getspecific’
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set’:
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create’
/home/chenxin/android/src/froyo/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific’
collect2: ld returned 1 exit status
解决方案:
修改./framework/base/tools/localize/Android.mk文件

10.
sh: 1: 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
解决方案:
sudo apt-get install gperf
0 条评论
发表一条评论

注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。