在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 ...
随机推荐
- UFLDL新版教程
http://ufldl.stanford.edu/tutorial/ 还带编程作业.
- Hive的JDBC访问
实现hive查询源码: String driverName = "org.apache.hive.jdbc.HiveDriver"; try { Class.forName(dri ...
- CF884D:Boxes And Balls
浅谈\(Huffman\)树:https://www.cnblogs.com/AKMer/p/10300870.html 题目传送门:https://codeforces.com/problemset ...
- Angular5学习笔记 - 集成Bootstrap、Jquery、Tether(三)
一.添加配置 cnpm i bootstrap jquery tether --save 添加后效果 二.配置添加样式和js的引用 打开.angular-cli.json文件,在styles和scri ...
- java事件练习!!
总结:不晓得怎么跟书上的运行结果显示的...希望标签竖直排列 package com.bc; import java.awt.Color; import java.awt.FlowLayout; im ...
- tree指令
tree 中文解释:tree功能说明:以树状图列出目录的内容.语 法:tree [-aACdDfFgilnNpqstux][-I <范本样式>][-P <范本样式>][目录.. ...
- malloc 动态分配内存
很久没有学习C了,复习下,有时候觉的C特别优美,学习算法和数据结构最佳选择. #include "stdafx.h" #include<stdlib.h> int ma ...
- “百度杯”CTF比赛 十一月场(Misc)
签到题: 题目提示: 文件在i春秋的ctf2群里,加群下载文件 下载下来之后发现有压缩密码 题目提示有提示解压密码:key:ichunqiumemeda 打开文件,得到flag 签到题2: 点击下载附 ...
- scrapy(1)安装
用的是python3.6 pip install -i https://pypi.douban.com/simple/ scrapy scrapy startproject Article scrap ...
- 解决ftp无法连接登录linux的办法
1. 首先安装vsftpd 命令:yum -y install vsftpd 之后开启服务:service vsftpd start 2.关闭防火墙 1) 重启后生效 开启: chkconfig ip ...