編譯Android原始碼過程中出現的錯誤

2021-07-07 04:52:01 字數 3531 閱讀 2528

錯誤1:

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

解決方法是安裝perl的switch庫:

sudo apt-get install libswitch-perl

錯誤2:

frameworks/base/include/utils/keyedvector.h:193:31: note: declarations in dependent base 『android::keyedvector>』 are not found by unqualified lookup

frameworks/base/include/utils/keyedvector.h:193:31: note: use 『this->indexofkey』 instead

make: *** [out/host/linux-x86/obj/static_libraries/libutils_intermediates/assetmanager.o] 錯誤 1

解決:

在frameworks/base/libs/utils/android.mk的第64行末尾新增'-fpermissive',中間用空格隔開,即:

local_cflags += -dlibutils_native=1 $(tool_cflags) -fpermissive

錯誤3:

external/srec/tools/thirdparty/openfst/fst/lib/cache.h:136:61: note: declarations in dependent base 『fst::vectorfstbaseimpl> >』 are not found by unqualified lookup

external/srec/tools/thirdparty/openfst/fst/lib/cache.h:136:61: note: use 『this->setstate』 instead

make: *** [out/host/linux-x86/obj/executables/grxmlcompile_intermediates/grxmlcompile.o] 錯誤 1

解決:

cd external/srec

wget ""

patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff

rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff

cd ../..

錯誤4:

dalvik/vm/native/dalvik_system_zygote.cpp:216:43: error: 『setrlimit』 was not declared in this scope

err = setrlimit(contents[0], &rlim);

解決:

在dalvik/vm/native/dalvik_system_zygote.cpp中間增加乙個標頭檔案定義#include 

#include "dalvik.h"

#include "native/internalnativepriv.h"

#include

錯誤5:

make: *** [out/host/linux-x86/obj/executables/emugen_intermediates/main.o] 錯誤 1
解決:

需要在  development/tools/emulator/opengl/host/tools/emugen/main.cpp

在宣告中增加一條標頭檔案宣告

#include

錯誤6:

make: *** [out/host/linux-x86/obj/static_libraries/libopenglcodeccommon_intermediates/glsharedgroup.o] error 1
解決:

在development/tools/emulator/opengl/android.mk的第25行新增'-fpermissive'emugl_common_cflags := -dwith_gles2 -fpermissive

android 系統原始碼簡單的編譯過程

在進行framework開發過程中,我們要對andorid原始碼進行編譯。以下是對android原始碼簡單的編譯過程。一 repo init u git 192.168.0.143 sdk yang s900 manifest.git repo sync 二 建立分支 repo start mast...

Debian編譯Android原始碼

筆記本 intel i3 ram 4g linux debian 8.1.0 amd64 xfce cd 1.iso android 4.2.2android官方推薦使用ubuntu編譯原始碼,但我試了ubuntu 12.04 ubuntu 14.04,結果都在安裝好所需檔案重啟電腦後,系統就出莫名...

ubuntu編譯android原始碼

1.首先為安裝ubuntu系統,大家可以參考以下鏈結 建議大家把 根目錄分70g以上 3.安裝編譯必備的工具 清華大學映象庫 5.編譯過程 6.用到的命令 卡住不動 ctrl z 清除make資訊 make clobber 開始編譯 build envsetup.sh 選擇版本 lunch 開始編譯...