我的操作系统: ubuntu10.10
首先,我们先安装一些常用的工具
curl: sudo apt-get install curl
git: sudo apt-get install git
g++: sudo apt-get install g++
android 源码的下载:
1. mkdir bin 建立bin目录
2. curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 导入repo执行脚本
3. chmod a+x ~/bin/repo 增加repo的执行权限
4. mkdir workspace 建立自己要存放源码的目录
5. repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 初始化项目列表
6. repo sync 下载项目
android 源码的编译和系统建立
1. cd workspace
2. source build/envsetup.sh
3. lunch full-eng
4. make -j4

android make 时可能遇到的问题

/usr/bin/ld: cannot find -lz
host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
解决方法: sudo apt-get install zlib1g-dev sudo apt-get install lib64z1-dev

/bin/bash: bison: command not found
Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y
bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
解决方法:sudo apt-get install bison

/bin/bash: flex: command not found
out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp: In function ‘int yyparse()’:
out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:1827: warning: deprecated conversion from string constant to ‘char*’
out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:1970: warning: deprecated conversion from string constant to ‘char*’
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
解决方法: sudo apt-get install flex

/usr/bin/ld: cannot find -lncurses
host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
解决方法:sudo apt-get install libncurses5-dev

fatal error: GL/glx.h: No such file or directory
development/tools/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp:22: fatal error: GL/glx.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1
解决方法:sudo apt-get install libgl1-mesa-dev

sh: gperf: not found
target Generated: libwebcore <= external/webkit/Source/JavaScriptCore/create_regex_tables
Generating CSSPropertyNames.h <= CSSPropertyNames.in
sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 140.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h'
解决方法:sudo apt-get install gperf

更多相关文章

  1. android字体闪烁动画(线程)
  2. windows下android 开发环境建立
  3. Android(安卓)ant 打包 ant -f build.xml release 出错
  4. 使用Android(安卓)studio导入源码工程
  5. android targetSdkVersion 改成28以后出的问题
  6. android字体闪烁动画(线程)
  7. Anko:Android(安卓)代码动态布局的新方案
  8. 笔记:Android(安卓)Studio发布项目到Bintray
  9. Android(安卓)源码启动虚拟机经验

随机推荐

  1. Android中滑屏初探 ---- scrollTo 以及 s
  2. 【干货】测试Android应用安全性
  3. Android(安卓)绘制原理浅析
  4. Android(安卓)下用 Pull 解析和生成 XML
  5. ANDROID音频系统散记之五:如何绕开多媒体
  6. android + red5 + rtmp
  7. Android(安卓)Studio如何查看获取MD5和SH
  8. android UI进阶之style和theme的使用
  9. android的call与Phone的实现分析
  10. 搭建Android开发平台(Android(安卓)studio