在ubuntu 14.04 编译android 2.3.1 错误解决办法
首先必须降低gcc版本:
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo rm -rf /usr/bin/gcc /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++
################ Fix 1 ##########################
Error:
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base 'android::KeyedVector<android::String8, android::sp<AaptDir> >' are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use 'this->indexOfKey' instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1
Fix:
vi frameworks/base/tools/aapt/Android.mk
Add '-fpermissive' to line 31:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive
################## Fix 2 ##########################
Error:
frameworks/base/include/utils/KeyedVector.h:193:31: error: 'indexOfKey' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base 'android::KeyedVector<android::String8, android::wp<android::AssetManager::SharedZip> >' are not found by unqualified lookup
frameworks/base/include/utils/KeyedVector.h:193:31: note: use 'this->indexOfKey' instead
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error 1
Fix:
vi frameworks/base/libs/utils/Android.mk
Add '-fpermissive' to line 64:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
问题三
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:26: note: declarations in dependent base 'fst::VectorFstBaseImpl<fst::CacheState<fst::GallicArc<fst::StdArc, (fst::StringType)0u> > >' are not found by unqualified lookup
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:132:26: note: use 'this->SetState' instead
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:61: error: 'SetState' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
SetState(cache_first_state_id_, cache_first_state_);
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1
解决办法:
cd external/srec
wget "https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff"
patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
cd ../..
此方法是我找的别人对于4.0版本源码问题的解决方法,我用在了2.3上,没有出现问题
dalvik_system_Zygote.c:191:19: error: storage size of 'rlim' isn't known
解决办法
添加头文件#include <sys/resource.h>到以下文件
dalvik/vm/native/dalvik_system_Zygote.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
解决办法
gcc和g++版本太高了
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo rm -rf /usr/bin/gcc /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC
contains: external/webkit/WebCore/bindings/scripts /etc/perl /usr/local/lib/per
l/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/p
erl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Web
Core/dom/make_names.pl line 38.
BEGIN failed--compilation aborted at external/webkit/WebCore/dom/make_names.pl l
ine 38.
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC
contains: external/webkit/WebCore/bindings/scripts /etc/perl /usr/local/lib/per
l/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/p
erl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Web
Core/dom/make_names.pl line 38.
BEGIN failed--compilation aborted at external/webkit/WebCore/dom/make_names.pl l
ine 38.
解决方法是安装perl的switch库:
[plain] view plaincopy


- sudo apt-get install libswitch-perl
在ubuntu 14.04 编译android 2.3.1 错误解决办法的更多相关文章
- [原]Ubuntu 14.04编译Android Kernel
如何编译android kernel参考官方文档:https://source.android.com/source/building-kernels.html 在Ubuntu 14.04上编译a ...
- Ubuntu 14.04 编译 Android 4.2.2 for Tiny4412
. . . . . 在学校里是用 Redhat 6.4 编译的 Android 4.2.2 很顺利,把源码包拷贝到笔记本上的 Ubuntu 14.04 上再编译遭遇了各种坑,所以便有了这篇博客记录解决 ...
- 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 ...
- Ubuntu 14.04 下 android studio 安装 和 配置【转】
本文转载自:http://blog.csdn.net/xueshanfeihu0/article/details/52979717 Ubuntu 14.04 下 android studio 安装 和 ...
- 【转】Ubuntu 上编译Android出现cannot find -lstdc++解决办法
[转]Ubuntu 上编译Android出现cannot find -lstdc++解决办法 在Ubuntu 12.04 x86_64机器上编译Android出现下面错误,是因为找不到32bit的li ...
- 使用 EasyBCD 安装Ubuntu 14.04 Error 15: file not found错误的解决方法
今天安装Window7 和 Ubuntu 14.04 双系统时,出现如下异常,记录一下. 安装过程是参考 http://www.linuxidc.com/Linux/2014-04/100369.ht ...
- ubuntu 14.04 编译安装 nginx
下载源码包 nginx 地址:http://nginx.org/en/download.html 下载nginx 1.4.7 编译前先安装两个包: 直接编译安装会碰到缺少pcre等问题,这时候只要到 ...
- VirtualBox4.3.12 安装ubuntu 14.04 分辨率过小(600*480)问题的解决方法
作为.net程序员,一直都跟windows系统打交道,在同事的影响下,今天安装了Ubuntu 14. 安装完系统就遇到了这个麻烦事,找了好久才解决,因此记录下来,或许对和我一样的Ubuntu新手有帮助 ...
- ubuntu 14.04编译安装xen4.4总结
1. 安装环境 操作系统:ubuntu14.04 xen版本:xen4.4 2. 依赖包的安装 在安装xen之前先进行依赖包的安装,在不停得尝试之后,总结出以下需要安装的依赖包. sudo apt-g ...
随机推荐
- 如何找回未保存过的 Excel 文件?
如何找回未保存过的 Excel 文件? 同事做了一个文件,未保存直接关闭,正常是找不回来的. 但是 Excel 有一个强大的自动保存功能,对没有保存的文件也可以找回.
- SQL Sever 学习系列之一
SQL Sever 学习系列之一 本学习系列,从实际工作需要中积累,对于一个新手而言,写出几条漂亮的查询语句,应该是可以受启发的. 一.问题的需求是:员工薪酬发放,现有资金能发放多少人,哪些人应得? ...
- 应用层-day02
web与HTTP web的应用层协议时超文本传输协议(HyperText Transfer Protocol HTTP) HTTP是由两个程序实现的:一个客户端程序和一个服务器程序. HTTP定义了w ...
- PhantomJS python 截屏
参考:https://www.cnblogs.com/LanTianYou/p/5578621.html # coding:utf8 from time import sleep from selen ...
- dirs命令
dirs命令显示当前目录栈中的所有记录(不带参数的dirs命令显示当前目录栈中的记录).dirs始终显示当然目录, 再是堆栈中的内容:即使目录堆栈为空, dirs命令仍然只显示当然目录. 语法 dir ...
- mycat接oracle和mysql多个实例
Mycat 后面接一个Oracle实例与一个MySQL实例,假设用户表,订单表,转账记录表,Oracle字符集为GBK的,MySQL字符集则要求UTF8的完成用户表与订单表到MySQL的迁移过程,要求 ...
- 转:面对一个全新的环境,作为一个Oracle DBA,首先应该了解什么
转载:面对一个全新的环境,作为一个Oracle DBA,首先应该了解什么 由于时间比较久了,找不到原文章的链接,先贴上内容供大家参考 在这里,不谈那些大的方面,比如了解整个IT环境整体情况,假设你已经 ...
- Python No module named pkg_resources
好记性不如烂笔头. I encountered the same ImportError today while trying to use pip. Somehow the setuptools p ...
- 本地测试html文件时CSS效果显示, 但是当django的服务器上运行时效果不显示
本地测试时各种效果都显示, 但是当在django服务器上测试时, 效果却不显示, 原因是我将css文件放在一个static文件夹里, 没有在settings中设置static_dir选项.将stati ...
- eclipse DDMS导出文件失败--android Failed to push the item
我们在写安卓程序的时候,经常会用Eclipse导出模拟器的文件管理里面的文件,但有时候会报错,导致无法导出文件. 报错信息 Failed to push selection: Local path d ...