在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 ...
随机推荐
- [转]浅谈Web缓存
在前端开发中,性能一直都是被大家所重视的一点,然而判断一个网站的性能最直观的就是看网页打开的速度.其中提高网页反应速度的一个方式就是使用缓存.一个优秀的缓存策略可以缩短网页请求资源的距离,减少延迟,并 ...
- git之clone
git clone 命令参数: usage: git clone [options] [--] <repo> [<dir>] -v, --verbose be more ver ...
- bzoj 4712 洪水——动态DP
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4712 因为作为动态DP练习而找到,所以就用动态DP做了,也没管那种二分的方法. 感觉理解似乎 ...
- FPGA中竞争冒险问题的研究
什么是竞争冒险? 1 引言 现场可编程门阵列(FPGA)在结构上由逻辑功能块排列为阵列,并由可编程的内部连线连接这些功能块,来实现一定的逻辑功能. FPGA可以替代其他PLD或者各种中小规模数 ...
- java代码swing编程JPaswordField类
总结:JPasswordField类是JTextField类的子类.用户在JPasswordField对象中输入的字符会被其他的字符替代 而挡住,JPasswordFiled组件主要用来输入口令 pa ...
- 隔行变色---bai
<!DOCTYPE html> <html> <style> .mousein { background-color:blue; cursor: pointer; ...
- 手机定位室内gps没信号
手机定位一般分3种,gps,手机信号基站,上网地点,其中gps信号一般只有户外有,所以在室外的时候只开启定位和gps就可以定位了,但是在室内没有gps的情况,就需要开网络定位了.
- Android实现智能提示的文本输入框AutoCompleteTextView
今天我们要讲一个十分简单的内容,就是一个安卓控件的使用,用法很简单,但是很常用的一个.这里我用两种不同的写法来处理.当然,无论用哪一种写法,效果都是一样的. 我们先来看效果图. 要实现这种效果十分简单 ...
- js中的toString
返回对象的字符串表示 objectname.toString([radix])参数 objectname 必选项.要得到字符串表示的对象. radix 可选项.指定将数字值转换为字符串时的进制 说明 ...
- 关于RAW 和 ASSEST文件夹的差异
以下内容转自:http://www.cnblogs.com/leizhenzi/archive/2011/10/18/2216428.html *res/raw和assets的相同点: 1.两者目录下 ...