编译环境:Ubuntu12.04 64位

Android源码:Android 4.3

以下问题是笔者亲自碰到,通过网上查询整合在一起的。

1.error while loading shared libraries: libz.so.1: cannot open shared object file:No such file or directory

这里所说不能加载libz.so.1这个包,所以需要下载,笔者使用了几种方法,以下是自己使用过,测试是OK的.

我们使用命令apt-get search 安装

apt-get install apt-file

在安装完后提示你使用apt-file update输入命名

apt-file 是用来查找某个命令或者某一个库所在的包的,具体用法如下

root@ubuntu:/home/zhenghui# apt-file search libz.so.1

lib32z1: /usr/lib32/libz.so.1

lib32z1: /usr/lib32/libz.so.1.2.8

libx32z1: /usr/libx32/libz.so.1

libx32z1: /usr/libx32/libz.so.1.2.8

zlib1g: /lib/x86_64-linux-gnu/libz.so.1

zlib1g: /lib/x86_64-linux-gnu/libz.so.1.2.8

这里我们发现已经找到了libz.so.1所以安装对应的包,执行命令

apt-get install lib32z1

2.“mkimage” command not found - U-Boot images will not be built

从网上说使用apt-get install uboot-mkimage 但是笔者没有得到解决,可能是使用的环境不一样,提示是:

root@ubuntu:/home/zhenghui# apt-get install uboot-mkimage

Reading package lists... Done

Building dependency tree

Reading state information... Done

Package uboot-mkimage is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

However the following packages replace it:

u-boot-tools:i386 u-boot-tools

E: Package 'uboot-mkimage' has no installation candidate

这里说下载两个u-boot-tools:i386 和u-boot-tools两个工具,这里就安装两个工具。

3.fatal error: zlib.h: No such file or directory

没有zlib.h这个文件,使用命令安装

apt-get install zlib1g-dev

4.gperf not found

解决方法:安装gperf

apt-get install gperf

5./usr/bin/ld: cannot find  -lncurses

解决方法:安装libncurses5-dev:i386则可以搞定

apt-get install libncurses5-dev:i386

6.fatal error: uuid/uuid.h: No such file or directory

这个是因为没有安装uuid软件开发包的原因,使用一下命令解决:

sudo apt-get install uuid-dev

在安装完了之后,可能需要做一个软链接 命令:

ln -sf /lib/i386-linux-gnu/libuuid.so.1 /usr/lib/libuuid.so

7.Can't locate Switch.pm in @INC

解决方法是安装perl的switch库,安装命令:

apt-get install libswitch-perl

8./bin/bash: xmllint: command not found

解决方法安装 xmllint 命令如下:

apt-get install libxml2-utils

9.make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] Killed

网上说内存不足,采用一下方法得到解决,增大交换分区的大小,这里就分了1G给交换分区:

在根目录创建swap文件夹:

mkdir swap

cd swap

sudo dd if=/dev/zero of=swapfile bs=1024 count=1048576

sudo mkswap swapfile //把生成的文件转换成 Swap 文件

sudo swapon swapfile //激活 Swap 文件

如果需要卸载。执行命令:swapoff swapfile

Andorid编译成功后,会在/out/target/product/sabresd_6dq下生成三个img:recovery.img 、system.img、 boot.img和u-boot.bin

Android源码编译出错解决办法的更多相关文章

  1. Ubuntu(64位)编译Android源码常见错误解决办法

    2013年07月10日 14:47:27 阅读数:1239 错误: /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file ...

  2. 转:CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法!

    yum安装包时报错: Could not retrieve mirrorlist http://mirrorlist.repoforge.org/el6/mirrors-rpmforge error ...

  3. CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法apt.sw.be couldn't connect to host

    yum安装包时报错: Could not retrieve mirrorlist http://mirrorlist.repoforge.org/el6/mirrors-rpmforge error  ...

  4. Android源码编译jar包BUILD_JAVA_LIBRARY 与BUILD_STATIC_JAVA_LIBRARY的区别(二)

    上文简单介绍了BUILD_JAVA_LIBRARY 与BUILD_STATIC_JAVA_LIBRARY编译出来jar包的区别, 那么你如果拿到了一个内容是dex格式的jar包,而你又偏偏需要这个ja ...

  5. [Android Pro] Android源码编译之Nexus5真机编译

    reference to : http://blog.csdn.net/liu1075538266/article/details/51272398 1.   前言 在Android安全的研究工作中, ...

  6. 有关android源码编译的几个问题

    项目用到编译环境,与源码有些差异不能照搬,关键是连源码都没编译过,下面基本上是行网上照的各种自学成才的分享,病急乱投医了,都记在下面作为参照吧. 1.验证是否编译正确,在终端执行 emulator & ...

  7. 【Android开发】构建Android源码编译环境

    原文:http://android.eoe.cn/topic/android_sdk 构建Android源码编译环境 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...

  8. android 源码编译中的错误 解决

    1.编译种错误提示: arm-none-linux-gnueabi-gcc: directory: No such file or directory arm-none-linux-gnueabi-g ...

  9. android源码编译环境的准备及编译之后使用emulator运行的方法 - 官方版

    http://source.android.com/source/initializing.html http://blog.csdn.net/ithomer/article/details/6977 ...

随机推荐

  1. JSON数据解析

    1 JSON简介 JSON(JavaScript Object Notation),类似于XML,是一种轻量级的数据交换格式,比如在JavaEE中Struts2与Ajax在来回传递数据时,除了可以利用 ...

  2. CI框架整合yar

    第一步:在CI框架中libraries目录下建立yar.php 文件 内容: <?php /** * yar 接口 */ class Yar { /** * 构造函数 * * @return v ...

  3. select元素中设置padding效果

    更新2016-9-17:这个bug是在mac os上的发生,在window系统中不存在这个问题! 给select元素增加:padding-left:20px;但是未生效,如下图所示: 在select上 ...

  4. left和offsetLeft

    left: 1.当该对象的定位position为absolute时left是相对于拥有定位属性(position的值为默认值"static"时除外)的父级对象的左边距. 例1:当父 ...

  5. white-space: nowrap 与字符串(文本)换行

    在需要对字符串进行元素内换行时,我们通常要对该元素设置相关属性约束以及宽度. 例如:style="word-wrap:break-word; word-break: break-all; w ...

  6. Selenium:元素等待的4种方法

    1.使用Thread.sleep(),这是最笨的方法,但有时候也能用到而且很实用. 2.隐示等待,隐性等待是指当要查找元素,而这个元素没有马上出现时,告诉WebDriver查询Dom一定时间.默认值是 ...

  7. 重写toString()方法来描述一个类

    package com.zch.test; /* toString方法以及重写toString方法 toString方法是一个自我描述方法 方法本身返回的是该对象的实现类的 类名 + @ + hash ...

  8. iOS scrollview循环播放加缩放

    前些日子一直在研究3d的框架没有时间写博客,不过最后需求改了,也没研究出个啥.这段时间出了新的需求,需要循环播放图片,并且滑动的时候中间的图片有缩放的效果.刚开始想在网上搜索,不过并没有找到合适的de ...

  9. 机器学习之KNN算法思想及其实现

    从一个例子来直观感受KNN思想 如下图 , 绿色圆要被决定赋予哪个类,是红色三角形还是蓝色四方形?如果K=3,由于红色三角形所占比例为2/3,绿色圆将被赋予红色三角形那个类,如果K=5,由于蓝色四方形 ...

  10. flume介绍与原理(一)

    1 .背景 flume是由cloudera软件公司产出的可分布式日志收集系统,后与2009年被捐赠了apache软件基金会,为hadoop相关组件之一.尤其近几年随着flume的不断被完善以及升级版本 ...