Fix some problem to build android2.3 on ubuntu11.10 32bit

错误1:

************************************************************

You are attempting to build on a 32-bit system.

Only 64-bit build environments are supported beyond froyo/2.2.

************************************************************

解决:

需要进行如下修改即可,将

./external/clearsilver/cgi/Android.mk

./external/clearsilver/java-jni/Android.mk

./external/clearsilver/util/Android.mk

./external/clearsilver/cs/Android.mk

四个文件中的

LOCAL_CFLAGS += -m64

LOCAL_LDFLAGS += -m64

注释掉,或者将“64”换成“32”

LOCAL_CFLAGS += -m32

LOCAL_LDFLAGS += -m32

然后,将./build/core/main.mk 中的

ifneq (64,$(findstring 64,$(build_arch)))

改为:

ifneq (i686,$(findstring i686,$(build_arch)))

错误2:

host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp

frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:

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]

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误 1

解决:

gedit frameworks/base/libs/utils/Android.mk

Change the line:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

To:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) –fpermissive

错误3:

host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':

/home/leno/works/android_dev/bin/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/leno/works/android_dev/bin/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create'

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific'

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] 错误 1

解决:

打开 frameworks/base/tools/aapt/Android.mk

然后打开文件Android.mk,编辑下面一行:

ifeq ($(HOST_OS),linux)

#LOCAL_LDLIBS += -lrt       把这行注释掉,改为下面一行。

LOCAL_LDLIBS += -lrt -lpthread

endif

错误4:

target Dex: core

#

# An unexpected error has been detected by HotSpot Virtual Machine:

#

#  SIGSEGV (0xb) at pc=0x4003d848, pid=7668, tid=2889534320

#

# Java VM: Java HotSpot(TM) Client VM (1.5.0_22-b03 mixed mode)

# Problematic frame:

# C  [libpthread.so.0+0xa848]  pthread_cond_timedwait+0x168

#

# An error report file with more information is saved as hs_err_pid7668.log

#

# If you would like to submit a bug report, please visit:

#   http://java.sun.com/webapps/bugreport/crash.jsp

#

make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.dex] 已放弃 (core dumped)

解决:

虚拟机给的内存512太小,给个1G试试。然后在本机里打开任务管理器,找到虚拟机进程,优先级设置为实时。给他最多东西。

错误 5:

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':

/home/leno/works/android_dev/bin/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/leno/works/android_dev/bin/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create'

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific'

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 错误 1

解决:类似问题3

修改./framework/base/tools/localize/Android.mk文件

ifeq ($(HOST_OS),linux)

#LOCAL_LDLIBS += -lrt       把这行注释掉,改为下面一行。

LOCAL_LDLIBS += -lrt -lpthread

endif
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值