一. 工具

sudo apt-get install git-core gnupg flex bison gperf build-essential \

      zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \

      libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \

      libgl1-mesa-dev g++-multilib mingw32 tofrodos \

      python-markdown libxml2-utils xsltproc zlib1g-dev:i386

二.JDK

oracle 官网下载JDk6_29(bin文件,注意安装方法,环境变量,update-alternative等)   http://www.oracle.com/technetwork/java/javase/archive-139210.html

三.gcc/g++的版本

 默认的gcc g++版本为4.6.3,  将其改为4.4.步骤:

 sudo apt-get install gcc-4.4
 sudo apt-get install g++-4.4
 cd /usr/bin
 ls -l gcc*
 sudo mv gcc gcc.bak
 sudo ln -s gcc-4.4 gcc
 ls -l g++*
 sudo mv g++ g++.bak
 sudo ln -s g++-4.4 g++
 gcc -v
 g++ -v

四.源的问题

  很多repo不能用,这个一般都可以: curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo
  另外。init的时候用这个: repo init -u git://git.omapzoom.org/platform/manifest -b android-4.0.1_r1
 
五 .同步后出现的问题
 
1. 出错以下出错信息:

  1. Import includes file: out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/import_includes
  2. target Generated: libwebcore <= external/webkit/Source/WebCore/css/tokenizer.flex
  3. <span style="rgb(255, 255, 51);">Can't locate Switch.pm in @INC (you may need to install the Switch module)</span> (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  4. BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  5. Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  6. BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
  7. make: *** [out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
  8. make: *** Waiting for unfinished jobs....
  9. make: *** [out/target/product/mx3/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] Error 2
  10. target Generated: libwebcore <= external/webkit/Source/WebCore/html/parser/HTMLEntityNames.in

解决方法是安装perl的switch库:

  1. sudo apt-get install libswitch-perl

2.dalvik/vm/native/dalvik_system_Zygote.cpp:216:43: error: ‘setrlimit’ was not declared in this scope
err = setrlimit(contents[0], &rlim);
^
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
dalvik/vm/native/java_lang_Float.cpp:1:0: note: this is the location of the previous definition
/*
^
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....

解决办法
添加头文件#include <sys/resource.h>到以下文件
dalvik/vm/native/dalvik_system_Zygote.cpp

3.host Executable: emulator_renderer (out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer)
/usr/bin/ld:
out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/main.o:
undefined reference to symbol 'XInitThreads'
//usr/lib/i386-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1
make: *** Waiting for unfinished jobs....

解决办法:
修改development/tools/emulator/opengl/host/renderer/Android.mk文件
root@ubuntu:/home/dzt/android/WORKING_DIRECTORY# ls
abi cts docs frameworks Makefile prebuilt
bionic dalvik download.sh hardware ndk sdk
bootable development download.sh~ hs_err_pid6190.log out system
build device external libcore packages v8.log
root@ubuntu:/home/dzt/android/WORKING_DIRECTORY# gedit development/tools/emulator/opengl/host/renderer/Android.mk

添加一行:LOCAL_LDLIBS += -lX11 注意最好是复制过去,右边的容易写错

在Ubuntu14.04上编译Android4.0.1出现的几个问题的更多相关文章

  1. 【转】Linux(ubuntu14.04)上编译Android4.4源码的环境搭建及编译全过程

    原文网址:http://jileniao.net/linux-android-building.html sublime text让我伤心.本来很信任sublime text的自动保存功能,之前使用一 ...

  2. 在ubuntu14.04上编译android4.2.2系统

    原创作品,转载请注明出处,严禁非法转载             copyright:weishusheng   2015.8.1 时下android系统非常流行,下面就来说一下,下载编译一个andro ...

  3. 在Ubuntu Server14.04上编译Android6.0源码

    此前编译过Android4.4的源码,但是现在Android都到了7.0的版本,不禁让我感叹Google的步伐真心难跟上,趁这周周末时间比较充裕,于是在过去的24小时里,毅然花了9个小时编译了一把An ...

  4. ubuntu14.04上编译安装python3.7.3

    首先先去python官网www.python.org下载python3.7.3的官方压缩包Python-3.7.3.tgz 一.先安装需要的包zlib1g,libffi apt-get update ...

  5. Ubuntu14.04 Chromium 编译

    1.下载depot_tools: 首先安装 git-core: sudo apt-get install git-core 执行命令: git clone https://chromium.googl ...

  6. ubuntu14.04下编译安装ambari-2.4.2.0

    ubuntu14.04下编译安装ambari-2.4.2.0 编译前的准备工作 准备工作有: 系统参数 系统依赖(编译环境) 离线安装包 java环境 maven环境 Nodejs环境 git环境 a ...

  7. [译]How to Install Node.js on Ubuntu 14.04 如何在ubuntu14.04上安装node.js

    原文链接为 http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/ 由作者Jacob Nicholson 发表于October ...

  8. 【转】基于Ubuntu 14.04 LTS编译Android4.4.2源代码

    原文网址:http://blog.csdn.net/gobitan/article/details/24367439 基于Ubuntu 14.04 LTS编译Android4.4.2源代码       ...

  9. Ubuntu14.04+eclipse下cocos2d-x3.0正式版环境的搭建

    环境: ubuntu14.04 adt-bundle-linux-x86_64 android-ndk-r9d-linux-x86_64 cocos2d-x-3.0正式版 apache-ant 1.9 ...

随机推荐

  1. 每日英语:A Chinese Soccer Club Has Won Something!

    A 1-1 tie at home was sufficient for Guangzhou Evergrande to clinch the Asian Champions League title ...

  2. PBR Metallic/Roughness工作流中Albedo与F0的计算方法

    首先简单回顾一下典型的纯金属与绝缘体的PBR属性: 纯金属: Albedo(diff): 0 F0(spec): >0.3 (or 0.5, epic/allegorithmic etc.) M ...

  3. Lua语法基础(3)--迭代器和泛型for

    迭代器和闭包 迭代器是一种支持指针类型的结构,它可以遍历集合的每一个元素.在Lua中我们常常使用函数来描述迭代器,每次调用该函数就返回集合的下一个元素. 迭代器需要保留上一次成功调用的状态和下一次成功 ...

  4. 【Android】输入设备配置文件(.idc文件)

    何为idc idc(Input Device Configuration)为输入设备配置文件,它包含设备具体的配置属性,这些属性影响输入设备的行为. 对于touch screen设备,总是需要一个id ...

  5. 设计模式之工厂方法模式(代码用Objective-C展示)

    前面一篇展示了一个简单工厂模式,这一篇主要是对比,工厂方法模式比简单工厂模式好在哪里?为什么要用这个模式?这个模式的精髓在哪里? 就以计算器为例,结果图如下: 加减乘除运算都是继承自基类运算类,然后工 ...

  6. Pyperclip – A cross-platform clipboard module for Python

    Usage is simple: import pyperclip pyperclip.copy('The text to be copied to the clipboard.') spam = p ...

  7. C#学习笔记(25)——用刻盘器批量从U盘删除添加文件

    说明(2017-11-17 14:46:05): 1. 因为经常要从U盘里面删除版本,然后添加版本,每次都要几个人手动复制粘贴,费时费力,就花了一下午时间写了个程序,自动删除和添加版本. 2. Dri ...

  8. Faiss教程:入门

    Faiss处理固定维度d的数据,矩阵每一行表示一个向量,每列表示向量的一项.Faiss采用32-bit浮点型存储. 假设xb为数据集,维度为\(nb\times{d}\):xq是查询数据,维度为\(n ...

  9. 键盘 Input子系统

    应用层测试代码 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <li ...

  10. 9g10在nandflash扇区的分配地址