编译android4.4源代码出现的问题及解决

0 因为编译uboot和kernel都比较顺利,所以不作描述java


1 /bin/bash:bios:未找到命令linux

解决:android

sudo   apt-get    install bison


2 cannot find flex

解决:ios

sudo   apt-get install flex


3 安装软件时发生依赖问题,

解决:更换国内软件源,网易、搜狐等bash


4 编译源码出现:
host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)
/home/pillar/fiio/G102/android/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/../lib/gcc/i686-linux/4.6.x-google/../../../../i686-linux/bin/ld: cannot find -llog
collect2: ld returned 1 exit status

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

解决:缘由是缺失liblog.so,所以经过命令来编译生成该库文件       make liblog  (须要较长时间)flex


5 ui

gcc: error trying to exec 'cc1plus': execvp: No such file or directory

缘由:gcc and g++ needs to be the same version.google

     take a look with "gcc --version" and "g++ --version" 或者 gcc -v  g++ -v查看发现gcc最新版本4.9.5,g++最新版本4.8.5,因此我须要把gcc版本降到4.8.5
解决:同步g++和gcc版本:   
sudo rm /usr/bin/gcc                            

 sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc

6code

In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
out/target/product/generic/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]  ...   cc1plus: all warnings being treated as errors
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1

缘由:这个问题的根本缘由仍是java版本的问题,经过命令blog

java -version

javac -version

javap -version

查看版本,设置三个版本一致才行