一. 工具

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. 【Delphi】@,^,#,$特殊符号意义

    概述 ^: 指针 @: 取址 #: 十进制符 $: 十六进制符   @ :取址运算符 var int :integer; p :^integer; begin new(P); int :=; p := ...

  2. java 多线程 27 :多线程组件之CountDownLatch

    前言 在多线程环境下,JDK给开发者提供了许多的组件供用户使用(主要在java.util.concurrent下),使得用户不需要再去关心在具体场景下要如何写出同时兼顾线程安全性与高效率的代码.之前讲 ...

  3. Android内存机制分析2——分析APP内存使用情况

    上面一篇文章说了Android应用运行在dalvik里面分配的堆和栈内存区别,以及程序中什么代码会在哪里运行.今天主要是讲解一下Android里面如何分析我们程序内存使用情况.以便后续可以分析我们程序 ...

  4. 设置定时任务(Timer类的介绍)

    设置定时任务(Timer类的介绍) 在我们的很多项目中,我们都须要用到定时任务,因此想借此博文来对定时任务进行一个介绍. 设置定时任务过程例如以下: 先new一个Timer对象 Timer timer ...

  5. html页面布局总结篇

    1. 使用float布局 注意点:使用浮动布局要注意清除浮动.使用伪类清除 浮动层:给元素的float属性赋值后,就是脱离文档流,进行左右浮动,紧贴着父元素(默认为body文本区域)的左右边框. 而此 ...

  6. [Socket]Socket进程间的通信

    转自:http://blog.csdn.net/giantpoplar/article/details/47657303 前面说到的进程间的通信,所通信的进程都是在同一台计算机上的,而使用socket ...

  7. AR2220 通过cpu-defend policy处理大量大量arp广播的小技巧

    今天发现有局域网里面有几台电脑中毒了,在大量的发送ARP报文,导致设备cpu利用率很高. 一.查看display cpu-defend statistics 发现arp-reply  arp-requ ...

  8. SpringMVC登录拦截器

    springmvc拦截器的配置.使用:1.自定义拦截器,实现HandlerInterceptor接口. package com.bybo.aca.web.interceptor; import jav ...

  9. k8s 题目

    这几个月参与了几场面试,设计了多道面试题,觉得可以综合考察应聘人对 kubernetes的掌握情况.在这里分享下,供应聘人自查以及其他面试官参考. 这些面试题的设计初衷并不是考察 kubernetes ...

  10. nvalid bound statement (not found)

    问题详情: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.coocaa.te ...