Android系統源碼編譯遇到的問題
1.Ubuntu16.04的make版本過高(4.1)而提示須要3.81或者3.82,所以須要下降make的版本。html
下載deb包,命令行安裝:sudo dpkg -i package.deb
2.編譯提示信息「 You are building on a case-insensitive filesystem.」
緣由爲用VMware共享文件夾致使分區不合適。
3.Linux下的.7z命令
->解壓:7za x android*.7z -r -o./linux
4.No rule to make target `out/target/product/generic/obj/SHARED_LIBRARIES/libwpa_client_intermediates/export_includes', needed by `out/target/product/generic/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/import_includes'android
這個問題我猜測是need by後面的文件沒有建立,我就是在out/... 下面建立了一個對應的文件以後就能夠編譯了。web
5.看提示說是Python下的某個.py文件不認識編碼。ui
估計是目錄中帶了中文(我是在~/桌面、目錄中執行的)編碼
6.Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] 錯誤 2
make: *** 正在等待未完成的任務....
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/platform/ColorData.cpp] 錯誤 2
target Generated: libwebcore <= external/webkit/Source/WebCore/html/parser/HTMLEntityNames.in.net
解決:sudo apt-get install libswitch-perl 命令行
7.make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1
make: *** Waiting for unfinished jobs....orm
解決:添加頭文件#include <sys/resource.h>到如下文件
dalvik/vm/native/dalvik_system_Zygote.cpphtm