Android源码编译出错解决办法

时间:2023-02-01 00:08:02

编译环境: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. C#引用类型(class)和值类型(struct)

    1. 值参数 当利用值向方法传递参数时,编译程序给实参的值做一份拷贝,并且将此拷贝传递给该方法.被调用的方法不传内存中实参的值,所以使用值参数时,可以保证实际值是安全的. using System; ...

  2. Python获取文件名

    本文实例讲述了python实现从URL地址提取文件名的方法.分享给大家供大家参考.具体分析如下: 如:地址为 http://www.jb51.net/images/logo.gif 要想从该地址提取l ...

  3. MvvmLight 绑定

    添加MvvmLight引用,通过Nuget: 加载nuget以后会有ViewModelLocator.cs: 新建自己的ViewModel,继承ViewModelBase: View 通过资源引用Vi ...

  4. python(3)-内置函数2

    frozenset()    定义一个不能添加修改的集合 >>> s = frozenset() >>> s.add("aaa") Traceb ...

  5. [进程管理]linux 下 进程和线程的区别(baidu 面试)

    进程是程序执行时的一个实例,即它是程序已经执行到课中程度的数据结构的汇集.从内核的观点看,进程的目的就是担当分配系统资源(CPU时间.内存等)的基本单位. 线程是进程的一个执行流,是CPU调度和分派的 ...

  6. Servlet 详解

    1.什么是 Servlet? Java Servlet 是运行在 Web 服务器或应用服务器上的程序,它是作为来自 Web 浏览器或其他 HTTP 客户端的请求和 HTTP 服务器上的数据库或应用程序 ...

  7. Linux下2号进程的kthreadd--Linux进程的管理与调度(七)

    2号进程 内核初始化rest_init函数中,由进程 0 (swapper 进程)创建了两个process init 进程 (pid = 1, ppid = 0) kthreadd (pid = 2, ...

  8. 原生CSS设置网站主题色—CSS变量赋值

    定义CSS变量 在css文件顶部定义css变量,注意必须以--开头,使用:root包括这几个变量 :root { --main-bg-color: #ff7675; --color1: #fbfee9 ...

  9. 关于div文字点击编辑的插件

    (function(w,i){ w.inputOut = new i(); })( window, function(){ var inputOut = function(){ this.into = ...

  10. 基于Centos搭建个人 Leanote 云笔记本

    系统要求:CentOS 7.2 64 位操作系统 下载启动 MongoDB Leanote 依赖 MongoDB 作为数据存储,下面开始安装 MongoDB: 下载 MongoDB 进入 /home  ...