Android系统编译常见问题

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/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 ../..

make:*[out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 1

解决:
sudo apt-get install gcc-4.8-multilib g++-4.8-multilib

make: * [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

解决:
sudo apt-get install libncurses5-dev:i386

make: * [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解决:
sudo apt-get install lib32z1-dev

make:*[out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1

解决:
sudo apt-get install libgl1-mesa-dev

make: * [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

解决:
sudo apt-get install build-essentia

make: * [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

解决:
sudo apt-get install build-essentia

make:*out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o Error 1

解决:
添加头文件#include 到以下文件
dalvik/vm/native/dalvik_system_Zygote.cpp

make: * [out/host/linux-x86/obj/EXECUTABLES/emugen_intermediates/main.o] Error 1

解决:
编辑文件  vim development/tools/emulator/opengl/host/tools/emugen/main.cpp
添加 include 

error: X11/Xlib.h: No such file or directory

解决:
x11没有安装完整,于是先输入:sudo apt-cache search x11-dev

libx11-dev - X11 client-side library (development headers)
libxkbcommon-x11-dev - library to create keymaps with the XKB X11 protocol - development files
libghc-x11-dev - Haskell X11 binding for GHC

输入:sudo apt-get install libghc-x11-dev即可    


make:*[out/host/linux-x86/o/STATIC_LIBRARIES/libOpenglCodecCommon_intermediates/GLSharedGroup.o] Error1

解决:
sudo vim development/tools/emulator/opengl/Android.mk
找到EMUGL_COMMON_CFLAGS := -DWITH_GLES2后面添加-fpermissive   
EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -fpermissive    

make: * [out/host/linux-x86/obj/lib/libOpenglRender.so] Error 1

解决:
首先安装这两个库文件的32位版本
 sudo apt-get install libx11-dev:i386
 sudo apt-get install libgl1-mesa-glx:i386 
 sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

/usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory
#include “zconf.h”
^
compilation terminated.
make: * [out/host/linux-x86/obj/EXECUTABLES/gpttool_intermediates/gpttool.o] Error 1

解决:
 由于系统的文件换了位置, 此时需要将 /usr/include/x86_64-linux-gnu/zconfig.h 拷贝到上级目录, 将 zconfig.h 拷贝到 /usr/include/ 目录即可 

make:* [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o]Error 1

解决:
修改源码目录下/build/core/combo/HOST_linux-x86.mk文件:
将以下语句
HOST_GLOBAL_CFLAGS+= -D_FORTIFY_SOURCE=0
修改为
HOST_GLOBAL_CFLAGS+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

make:*[out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1

解决:
sudo vim development/tools/emulator/opengl/host/renderer/Android.mk
add   LOCAL_LDLIBS += -lX11
结构如下
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS    += -O0 -g
LOCAL_LDLIBS += -lX11


make:*[out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] Error 1

解决:
sudo vim frameworks/base/libs/utils/Android.mk
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

make:* [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1

解决:
vim frameworks/base/tools/aapt/Android.mk
在第31行增加:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive

/bin/bash: line 2: javadoc: command not found
make:*[out/target/common/docs/doc-comment-check-timestamp] Error 45

解决:
这个比较坑,找了半天才解决
网上说的一种方法是这样的
修改下面四个文件:修改里面的东西,
 external/clearsilver/cgi/Android.mk
 external/clearsilver/java-jni/Android.mk
 external/clearsilver/util/Android.mk
 external/clearsilver/cs/Android.mk
 你会发现,如果是4.0的里面压根都没有clearsilver这个目录
 看看上一句的报错,看看哪个命令找不到,我的报错是这样的
 javadoc: command not found
 一般都是这个吧,java和javac我们都是配置过环境变量的
 缺少哪个命令就给哪个命令做个软链接
 sudo ln -s /usr/lib/jvm/java-6-1.6.7/bin/javadoc /bin/javadoc
 -s后面的第一个路径是写你自己jdk的路径,
 如果第一个路径配置错了,继续配置的时候会提现已存在,配置不上
 把刚才的软链接删掉即可
 命令:rm -rf file1soft
 如:rm -rf /bin/javadoc

推荐博客

你可能感兴趣的:(错误分析)