Android系统编译过程中常见问题汇总(1)

作者:徐文

1、问题一:/bin/bash: bison: 未找到命令

解决方法:$ sudo apt-get install bison

2、问题二:

You are attempting to build with the incorrect version of java.

Your version is: /bin/bash: java: 未找到命令.

The correct version is: 1.5.

解决方法:

注意:必须使用1.5的JDK版本。不能使用1.6等其他版本。

(1) 下载

在sun官网上下载jdk-1_5_0_22-linux-i586.bin。注意不是jdk-1_5_0_22-linux-i586rpm.bin

(2) 部署

进入jdk-1_5_0_22-linux-i586.bin所在目录

cd ~

赋予该bin文件可执行属性

chmod +x jdk-1_5_0_22-linux-i586.bin

一直回车跳过协议到最后一行:

Do you agree to the above license terms? [yes or no]

键入yes回车,开始解压。默认解压到当前目录下的jdk1.5.0_22目录里。

(3) 配置环境变量

执行$gedit ~/.bashrc打开.bashrc文件。

修改./bashrc文件,在文件末尾添加

#set java environment

JAVA_HOME=“你的路径”/jdk1.5.0_10
export JRE_HOME=“你的路径”/jdk1.5.0_10/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

保存并关闭文件。

在终端执行source ~/.bashrc刷新该配置

使用java –version检查JDK是否配置正确。

3、问题三:

host c++: libhost <= build/libs/host/pseudolocalize.cpp/bin/bash: g++: 未找到命令

make: ***[out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] 错误 127

解决方法:$ sudo apt-get install build-essential

4、问题四:

external/clearsilver/cgi/cgi.c:22:18: 致命错误: zlib.h: 没有那个文件或目录编译终端。

make: ***[out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] 错误 1

解决方法:$ sudo apt-get install zlib1g-dev

5、问题五:

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

解决方法:

打开Android.mk文件

$gedit frameworks/base/tools/aapt/Android.mk

编辑下面一行:

ifeq ($(HOST_OS),linux)

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

LOCAL_LDLIBS += -lrt -lpthread

endif

6、问题六:

host c: adb<= system/core/adb/fdevent.c

host Executable:adb (out/host/linux-86/obj/EXECUTABLES/adb_intermediates/adb)/user/bin/ld: cannot find –lncurses

collect2: ld 返回 1

make: ***[out/host/linux-86/obj/EXECUTABLES/adb_intermediates/adb] 错误 1

解决方法:$sudo apt-get install libncurses5-dev

7、问题七:

make: ***[out/target/product/sam9g45/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] 错误 25

解决方法:$sudo apt-get install gpert

8、问题八:

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

解决方法:

打开Android.mk

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

将下面这一行

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

改为

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

9、问题九:

make: ***[out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/skin/window.o] Error 1

解决方法:$ sudo apt-get install libx11-dev

10、问题十:

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

解决方法:

打开Android.mk:

$gedit ./framework/base/tools/localize/Android.mk文件(注意与问题五中的文件是不同文件)

编辑下面一行:

ifeq ($(HOST_OS),linux)

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

LOCAL_LDLIBS += -lrt –lpthread

转载请注明出处:http://blog.csdn.net/pku_android

11、问题十一:

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

解决方法:

打开Android.mk:

$gedit system/core/libacc/tests/Android.mk(注意与问题五和问题十不是同一个文件)

将以下缺少的语句添加进去:

LOCAL_SHARED_LIBRARIES := \

libacc

LOCAL_LDLIBS += -ldl

LOCAL_MODULE_TAGS := tests

在include $(BUILD_HOST_EXECUTABLE)下面添加以下缺少的语句:

LOCAL_SHARED_LIBRARIES := \

libacc

LOCAL_LDLIBS += -ldl

LOCAL_MODULE_TAGS := tests

发布了0 篇原创文章 · 获赞 4 · 访问量 3万+
展开阅读全文

bash: rt: 未找到命令... (profile没有 “tr”)

12-12

linux执行 “source /etc/profile” 时提示 “bash: rt: 未找到命令... 相似命令是: 'tr' ” 但是在profile中找了半天没发现“tr”,下面是源码 ,请哪位大神帮忙看看!!!万分感谢~~ ``` # /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates. pathmunge () { case ":${PATH}:" in *:"$1":*) ;; *) if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi esac } if [ -x /usr/bin/id ]; then if [ -z "$EUID" ]; then # ksh workaround EUID=`/usr/bin/id -u` UID=`/usr/bin/id -ru` fi USER="`/usr/bin/id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" fi # Path manipulation if [ "$EUID" = "0" ]; then pathmunge /usr/sbin pathmunge /usr/local/sbin else pathmunge /usr/local/sbin after pathmunge /usr/sbin after fi HOSTNAME=`/usr/bin/hostname 2>/dev/null` HISTSIZE=1000 if [ "$HISTCONTROL" = "ignorespace" ] ; then export HISTCONTROL=ignoreboth else export HISTCONTROL=ignoredups fi export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL # By default, we want umask to get set. This sets it for login shell # Current threshold for system reserved uid/gids is 200 # You could check uidgid reservation validity in # /usr/share/doc/setup-*/uidgid file if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then umask 002 else umask 022 fi for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null fi fi done unset i unset -f pathmunge ``` 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览