编译安卓5.0的源码还是建议 使用低版本的ubuntu!!!!
问题一:
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp
解决方法:
export LC_ALL=C
问题二:
Traceback (most recent call last):
File "../build/android/gyp/gcc_preprocess.py", line 50, in <module>
sys.exit(main(sys.argv))
File "../build/android/gyp/gcc_preprocess.py", line 43, in main
DoGcc(options)
File "../build/android/gyp/gcc_preprocess.py", line 28, in DoGcc
build_utils.CheckCallDie(gcc_cmd)
File "/home/geo/Android4.4/mydroid/external/chromium_org/build/android/gyp/util/build_utils.py", line 91, in CheckCallDie
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
解决方法:
这个问题在网上查了很多,说到底是gcc和g++的版本问题,ubuntu20.04自带是gcc-9和g++-9。版本太高需要降级到gcc-4.4。但是无法使用apt来安装,因为源连接中并没有这个版本,最后用下面的方法解决问题;
1.gcc-4.4的安装包源路径是:
deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe
2.使用下面的命令打开/etc/apt/sources.list文件将上面源路径添加在文件末尾:
sudo vim /etc/apt/sources.list
3.更新:sudo apt-get update
4.安装gcc-4.4以及g++-4.4:sudo apt-get install gcc-4.4 g++-4.4
5.查看版本号:(我这块没找到自带的gcc-9和g++-9,下载完4.4版本,查出的版本号就是4.4。由于这不是主要研究的内容,就没深究。)
6.重新编译,上述问题即可解决。
问题三:
解决方法:
sudo apt-get install libswitch-perl
sudo apt-get install gperf
问题四:
解决方法:
sudo apt-get install bison
---------------------------------------------------------------------------------------------------------------------------------
由于ubuntu根目录分配的空间较小,只能卸载重新安装并重新编译运行源码。。。。。遇到的一些新的问题整理,方便之后查询。
问题四:
make: *** [out/target/product/generic/system/etc/apns-conf.xml] 错误 127
解决方法:
sudo apt-get install libxml2-utils
问题五:
make: *** [out/host/linux-x86/bin/validatekeymaps] Error 127
解决方法:
sudo apt-get install g++-multilib
问题六:
error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory 这是因为你64位的系统没有32位的类库,但是安卓sdk需要32位的支持。
解决方法:
sudo apt-get update
sudo apt-get install lib32z1
问题七:编译成功后,使用emulator命令运行模拟器时出现的问题
解决方法:
emulator -partition-size 1024
问题八:上述第七个问题解决后,运行虚拟机出现新报错。
Failed to load libGL.so
解决方法:
sudo apt-get install libgl1-mesa-dev