1. 编译时出现/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searching for -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 searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解决办法:缺少lib32z1-dev,安装即可:apt-get install lib32z1-dev

2.   [android]编译时出现 /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory 错误信息
    编译时出现 /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 such file or directory
    compilation terminated.
    make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

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

3. 编译时出现 /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 such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

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

4.     [android]初始化代码仓库时出现“OSError: [Errno 2] No such file or directory”错误

OSError: [Errno 2] No such file or directoryroot@shanmin-ubuntu:/home/android/src# ../repo init -u git://android.git.kernel.org/platform/manifest.git
    Traceback (most recent call last):
      File "../repo", line 595, in <module>
        main(sys.argv[1:])
      File "../repo", line 562, in main
        _Init(args)
      File "../repo", line 181, in _Init
        _CheckGitVersion()
      File "../repo", line 210, in _CheckGitVersion
        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
      File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
        errread, errwrite)
      File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory

解决办法:  这是由于没有安装git造成的,安装上git就可以了。按说程序里面应该判断一下系统是否安装了git,不知道为什么没有判断。 apt-get install git

5.      太不容易了,终于看到自己编译的Android了
可能是我使用的机器比较慢,虚拟机运行的有些慢啊。。。。
太不容易了,终于看到自己编译的Android了 -  - 
下一步开始研究这个系统怎样去定制了....
编译Android,遇到Your version is: /bin/bash: java: command not found.错误的解决

Your version is: /bin/bash: java: command not found.============================================
            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
            ============================================
            /bin/bash: bison: command not found
            Checking build tools versions...
            ************************************************************
            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.6.

Please follow the machine setup instructions at
http://source.android.com/source/download.html
            ************************************************************
            build/core/main.mk:114: *** stop.  Stop.

解决办法: 这是由于没有装jdk导致的,可以到sun.com下载jdk后安装,建议安装到/usr/lib /jvm目录下,例如我下载的安装文件为 jdk-6u21-linux-i586.bin,安装完后生成一个jdk1.6.0_21的目录,然后使用ln -s jdk1.6.0_21 java-6-sun命令做一个链接,这样以后再升级sun jdk时只需要改动一下链接就可以了。

6. 编译Android,遇到Could not load 'clearsilver-jni'错误的解决

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] Error 45

从网上查得的解决办法:
make clean
make update-api (经测试,这个可以不需要)
make

7. Android编译环境中的JDK存放位置
    因为Ubuntu 10.04已经不带有SUN JDK,所以这个需要到sun网站上下载,并手动安装。所以,这个安装位置的问题就出现了。开始的时候没有注意,随便找了一个位置,并且设置了 JAVA_HOME就可以正常使用了。后来查看build/envsetup.sh才发现,如果没有设置JAVA_HOME的时候,编译环境会自动设置为 /usr/lib/jvm/java-6-sun ,所以建议直接安装到这个目录,还省得进行设置。

杯具了,VMware虚拟盘文件出现错误...

晕死了,不说别的,就下载Android的源代码就得差不多一天啊......

杯具了,VMware虚拟盘文件出现错误... -  - 
        似乎昨晚关机的时候强关的机器,没想到会影响这么大。。。。。

8. Android编译遇到错误/usr/bin/ld: cannot find -lstdc++的解决
             首先发现编译2.2版,gcc4.3和gcc4.4没有什么区别。

/usr/bin/ld: cannot find -lstdc++

============================================
            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
            ============================================

host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
            /usr/bin/ld: cannot find -lstdc++
            collect2: ld returned 1 exit status
            make: *** [out/host/linux-x86/obj/lib/libneo_util.so] 错误 1

解决办法:缺少g++-multilib库,安装即可: apt-get install g++-multilib  

9.  Android编译遇到错误
             环境: vmware + ubuntu 10.04
            使用gcc 4.3或gcc 4.4都会出错误信息:

host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
            /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
            /usr/bin/ld: cannot find -lstdc++
            collect2: ld returned 1 exit status
            make: *** [out/host/linux-x86/obj/lib/libneo_util.so] 错误 1

现在不知道怎么解决,按照http://www.ways2u.com/?post=163 写的使用gcc 4.3就不会有这个问题,但我这边还是出现这个错误。。。。

10. android编译环境

android所有源代码在 http://android.git.kernel.org/

如果在Windows下只能使用git一个项目一个项目的下载,如果在linux可以直接使用repo下载全部代码

linux下的全部下载方式见 http://source.android.com/source/git-repo.html

必须安装gcc 4.3才可以,例如我用的ubuntu 10.04默认装的是4.4,编译就会出错。

在装完Eclipse & SDK后,编译Android需要安装部分软件:

apt-get install bison

apt-get install g++

apt-get install libc6-dev-amd64

到源代码目录执行

make

即可

[转]编译Android源代码常见错误解决办法的更多相关文章

  1. PHP编译安装时常见错误解决办法,php编译常见错误

    PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt & ...

  2. 7.2.*PHP编译安装时常见错误解决办法,php编译常见错误

    configure: error: Cannot find ldap.h   检查下面是不是已经安装,如果没有安装之:检查:yum list openldapyum list openldap-dev ...

  3. 【转】ubuntu源码编译安装php常见错误解决办法

    ./configure -prefix=/usr/local/php -with-config-file-path=/etc -with-mysql=mysqlnd -with-mysqli=mysq ...

  4. linux编译安装时常见错误解决办法

    This article is post on https://coderwall.com/p/ggmpfa 原文链接:http://www.bkjia.com/PHPjc/1008013.html ...

  5. PHP编译安装时常见错误解决办法

    转载自:http://www.bkjia.com/PHPjc/1008013.html This article is post on https://coderwall.com/p/ggmpfa c ...

  6. hadoop 集群常见错误解决办法

    hadoop 集群常见错误解决办法 hadoop 集群常见错误解决办法: (一)启动Hadoop集群时易出现的错误: 1.   错误现象:Java.NET.NoRouteToHostException ...

  7. Visual Studio Xamarin编译Android项目出错的解决办法

    安装完Xamarin后,编译Android项目时,你会发现好长时间进度都不动,当你取消编译后,会发现其实是出错了,就是因在Android项目在第一次编译时要去google网站上下一个andorid s ...

  8. Linux常见错误解决办法

    1. 程序运行的一些基础知识 1. 编译程序时去哪找头文件? 系统目录:就是交叉编译工具链里的某个 include 目录:也可以自己指定:编译时用 " -I dir "选项指定. ...

  9. Android Studio 常见异常解决办法

    Error:Failed to crunch file D:\Englis_installation_directory\AndroidStudio\AndroidWorkSpace\YoukAndr ...

随机推荐

  1. JavaScript实现dropdownlist选定值后将选定值的key与value填入两个textbox中

    <script language="javascript" type="text/javascript"> var txtText0 = " ...

  2. 包含Blob字段的表无法Export/Import

    最近一直用MySQL-Front的导出导出工具完成数据库的备份,确实比较方便快捷. 后来增加了一张表,其中有blob字段,上传几个文件后,发现导出不好用了,进度条长期处于停滞状态. 想想也是,要把bl ...

  3. Python处理时间 time && datetime 模块

    Python处理时间 time  &&  datetime 模块 个人整理,获取时间方式: import datetime import time #获取当前时间:Thu Nov 03 ...

  4. What algorithm to use to normalize someone's face on image

    http://stackoverflow.com/questions/7066104/what-algorithm-to-use-to-normalize-someones-face-on-image

  5. Linux命令行–理解Linux文件权限(转)

    6.1.1 /etc/passwd文件 /etc/passwd:包含系统用户账户列表以及每个用户的基本配置信息 每个条目有七个字段,每个字段用冒号隔开 登录用户名 用户密码 用户账户的UID 用户账户 ...

  6. 在Ubutu14.04的Eclipse启动Tomcat的问题

    PS:因为tomcat文件夹的权限问题,导致我研究了一中午,首先是New Server时,不能输入server name,之后我删除了 org.eclipse.wst.server.core.pref ...

  7. android开发经验

    1.选好"车轮" 一个项目的开发,我们不可能一切从0做起,如果真是这样,那同样要哭瞎.因此,善于借用已经做好的 "车轮" 非常重要,如: 网络访问框架:okht ...

  8. Linux中硬件相关命令

    http://www.cnblogs.com/cchust/p/3354570.html http://www.cnblogs.com/kerrycode/archive/2012/07/06/257 ...

  9. 如何禁止DELETE、PUT、OPTIONS、TRACE、HEAD等协议访问应用程序 .

    原文:http://linder.iteye.com/blog/735435   简介 WebDAV (Web-based Distributed Authoring and Versioning)是 ...

  10. 第九篇 Integration Services:控制流任务错误

    本篇文章是Integration Services系列的第九篇,详细内容请参考原文. 简介在前面三篇文章,我们创建了一个新的SSIS包,学习了脚本任务和优先约束,并检查包的MaxConcurrentE ...