Android源码编译出错解决办法
编译环境: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源码编译出错解决办法的更多相关文章
- 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 ...
- 转:CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法!
yum安装包时报错: Could not retrieve mirrorlist http://mirrorlist.repoforge.org/el6/mirrors-rpmforge error ...
- CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法apt.sw.be couldn't connect to host
yum安装包时报错: Could not retrieve mirrorlist http://mirrorlist.repoforge.org/el6/mirrors-rpmforge error ...
- Android源码编译jar包BUILD_JAVA_LIBRARY 与BUILD_STATIC_JAVA_LIBRARY的区别(二)
上文简单介绍了BUILD_JAVA_LIBRARY 与BUILD_STATIC_JAVA_LIBRARY编译出来jar包的区别, 那么你如果拿到了一个内容是dex格式的jar包,而你又偏偏需要这个ja ...
- [Android Pro] Android源码编译之Nexus5真机编译
reference to : http://blog.csdn.net/liu1075538266/article/details/51272398 1. 前言 在Android安全的研究工作中, ...
- 有关android源码编译的几个问题
项目用到编译环境,与源码有些差异不能照搬,关键是连源码都没编译过,下面基本上是行网上照的各种自学成才的分享,病急乱投医了,都记在下面作为参照吧. 1.验证是否编译正确,在终端执行 emulator & ...
- 【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 ...
- android 源码编译中的错误 解决
1.编译种错误提示: arm-none-linux-gnueabi-gcc: directory: No such file or directory arm-none-linux-gnueabi-g ...
- android源码编译环境的准备及编译之后使用emulator运行的方法 - 官方版
http://source.android.com/source/initializing.html http://blog.csdn.net/ithomer/article/details/6977 ...
随机推荐
- 关于html转pdf
本篇作为一个备忘,记录一下html转pdf中遇到的问题. 没有具体做这个东西的时候不知道,网络上能将html转换成pdf的资源并不太多,使用上有很多都存在一些问题.能完美将一个站点中的页面(这里说一个 ...
- vs快捷键
原文地址 ctrl是强制功能键,shift有给项目增加功能作用 1. 窗口快捷键 : window Ctrl+W,W: 浏览器窗口 (window shopping ) Ctrl+W,S: 解决方案 ...
- SQL Server 2014 安装图解
服务器:Windows server 2012 R2 SQL:SQL Server 2014 Step 1 安装前 双击 Setup.exe 安装文件 选择第一项:New SQL Server sta ...
- Sprint(第十二天11.25)
- 该用 QGraphicsView ? QtQuick-QML ?
目前QtQuick (2014/3/6) 已经发展了有一段时间了,很多人在用因此我也想看看是否适合我目前的项目. 我要做的是一个类似3DMax中的材质编辑器的东西,里面有成千上万的”表单“(不知道怎么 ...
- 零配置文件搭建SpringMVC实践纪录
本篇记录使用纯java代码搭建SpringMVC工程的实践,只是一个demo.再开始之前先热身下,给出SpringMVC调用流程图,讲解的是一个http request请求到达SpringMVC框架后 ...
- 【转】 memcmp源码实现
原型: int memcmp(void *buf1, void *buf2, unsigned int count); 用法:#include <string.h> 功能:比较内存区域bu ...
- 推荐两本学习linux的经典书籍
- jquery阻止元素冒泡的两种方法
通常情况下,如果给父元素添加事件之后,子元素也会继承同样的事件,这个时候就要阻止子元素的这种行为,成为阻止冒泡,总结两种解决方法: html代码: <div id="parent&qu ...
- Struts2标签之Checkbox
<s:checkbox name="permisskey" label="帅哥" value="true" fieldValue=&q ...