Android介绍以及源码编译--常见编译错误

六. 常见编译错误

  在新安装的Ubuntu系统下,第一次编译Android源码问题很多。以下都是在执行make命令后,编译过程中出现的问题。

      原则是make遇到缺什么就安装什么,通过Google+ Baidu 搜索报错。

 

  • 错误:/bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
  • 解决:为了防止出现同样的权限问题,我将所有Android文件全部加上了权限,进入Android源码根目录,执行

    $sudo chmod 777 * -R

 

  • 错误: make[3]: *** [out/target/common/docs/doc-comment-check-timestamp] Error 45
  • 解决:软连接
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/jar /bin/jar
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/java /bin/java
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/javac /bin/javac
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/javah /bin/javah
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/javadoc /bin/javadoc
    $sudo ln -s /usr/lib/jvm/jdk1.6.0_45/bin/java /bin/java

        

  • 错误make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libEGL_translator_intermediates/EglX11Api.o] Error 1:
  • 解决: 
    $ sudo apt-get install libgl1-mesa-dev

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
  • 解决
    $sudo apt-get install zlib1g-dev
    $sudo apt-get install lib64z1-dev

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
  • 解决
    $sudo apt-get install bison

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
  • 解决
    $sudo apt-get install flex

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
  • 解决
    $sudo apt-get install libncurses5-dev

             

  • 错误:make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1
  • 解决
    $sudo apt-get install libgl1-mesa-dev

             

  • 错误:make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h‘
  • 解决
    $sudo apt-get install gperf

     

  • 错误:/usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
  • 解决
    $sudo apt-get install libc6-dev-i386

     

  • 错误:external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
  • 解决
    $sudo apt-get install zlib1g-dev

 

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
  • 解决
    $sudo apt-get install flex

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127
  • 解决
    $sudo apt-get install bison

     

  • 错误:make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1
  • 解决: 
    $sudo apt-get install lib32z1-dev

  


 

  参考:

  http://blog.sina.com.cn/s/blog_ab85e99501018r6z.html
  http://www.cnblogs.com/wdpp/archive/2011/11/16/2386719.html
  http://indiansmartphones.wordpress.com/2011/05/18/solution-to-fatal-error-glglx-h-no-such-file-or-directory/
  http://blog.csdn.net/iamliuyanlei/article/details/8830981
  http://blog.sina.com.cn/s/blog_ab85e99501018r6z.html

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。