Android源码4.4编译
在编译Android时遇到一些问题,及时记下,以防以后忘记:
环境
Java环境
- JdK1.6
需要用到的命令
- sudo apt-get install make flex gcc g++ libc6-dev patch texinfo zlib1g-dev valgrind libc6:i386 ia32-libs
- sudo apt-get install python2.7(或者更高版本)
编译
source build/envsetup.sh
lunch
make -j4
make systemimage 生成system.img
更多命令参照:http://gityuan.com/2016/03/19/android-build/
=================编译问题=============
问题1=============
File "scripts/make_css_value_keywords.py", line 177, in <module>
File "scripts/make_css_property_names.py", line 238, in <module>
in_generator.Maker(CSSValueKeywordsWriter).main(sys.argv)
in_generator.Maker(CSSPropertiesWriter).main(sys.argv)
File "/opt/cBPM-android/android4.4_source_code/external/chromium_org/third_party/WebKit/Source/core/scripts/in_generator.py", line 119, in main
File "/opt/cBPM-android/android4.4_source_code/external/chromium_org/third_party/WebKit/Source/core/scripts/in_generator.py", line 119, in main
writer.write_files(options.output_dir)
writer.write_files(options.output_dir)
File "/opt/cBPM-android/android4.4_source_code/external/chromium_org/third_party/WebKit/Source/core/scripts/in_generator.py", line 77, in write_files
File "/opt/cBPM-android/android4.4_source_code/external/chromium_org/third_party/WebKit/Source/core/scripts/in_generator.py", line 77, in write_files
self._write_file(output_dir, generator(), file_name)
self._write_file(output_dir, generator(), file_name)
File "scripts/make_css_property_names.py", line 233, in generate_implementation
File "scripts/make_css_value_keywords.py", line 172, in generate_implementation
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [out/target/product/generic/obj/GYP/shared_intermediates/blink
解决方法
sudo apt-get install gperf
问题2=============
Traceback (most recent call last):
File "scripts/rule_bison.py", line 75, in <module>
returnCode = subprocess.call([bisonExe, '-d', '-p', prefix, inputFile, '-o', outputCpp])
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
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
解决方法
sudo apt-get install bison
问题3=============
/bin/bash: xmllint: command not found
make: *** [out/target/product/generic/system/etc/apns-conf.xml] Error 127
make: *** Waiting for unfinished jobs....
解决方法
sudo apt-get install libxml2-utils