Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Andriod源碼編譯常見錯誤

Andriod源碼編譯常見錯誤

編輯:關於Android編程

做Android編碼開發時,首先是搭建環境,第一次編譯Android源碼本該一次通過,可人生不如意十之八九,總會遇到各種環境問題,大都跟軟件包有關,Ubuntu每個版本默認安裝的軟件包及其版本都不同,所以,一旦遇到編譯問題,實在無法解決,最好首先向官方推薦的系統環境靠齊,本文整理自之前開發筆記,部分錯誤及解決辦法來源於文末參考地址。

本文系統:Ubuntu 10.10 desktop amd64,Android 2.3/mtk

常見錯誤列表如下:

---------------------------------

Error: /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory compilation terminated. make: *** [bitmap.o] Error 1

Install: libc6-dev-i386

---------------------------------

Error: skipping incompatible /usr/lib/libz.so

Install: lib32z1-dev

---------------------------------

Error: register.inc.list: No such file or directory

Install: apt-get install linux-kernel-headers

備注:ubuntu的話是linux-kernel-headers,fedora才是kernel-headers

---------------------------------

Error: make[3]: *** [out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/tests] Killed

make[3]: *** Waiting for unfinished jobs....

Solution: Try to reinstall Ubuntu on single driver instead of using wubi.exe as a vmdisk

---------------------------------

Error:

find: `frameworks/base/frameworks/base/docs/html': No such file or directory

find: `out/target/common/docs/gen': No such file or directory

find: `packages/partner/xt9': No such file or directory

Solution:

Create these folders, yes, just a empty folder.

備注:以上報錯上從提示上可以看出是某個編譯變量的把相對路徑/絕對路徑搞錯了,只需要創建對應的空文件夾即可,天緣實際使用中發現,可能跟我們的工程配置有關,如果調整適當,比如上面的xt9,可以檢查xt9輸入法開關/編譯配置等地方,應該不會報上文錯誤的。

---------------------------------

Error:find: `mediatek/source/frameworks/blueangel/java/android': No such file or directory

Solution: Try to check BT settings in your  project config file.

---------------------------------

Error: external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory

Resolution: apt-get install zlib1g-dev

---------------------------------

Error: make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error 1

Install: apt-get install g++-multilib

---------------------------------

Error:

sh: gperf: not found

calling gperf failed: 32512 at ./makeprop.pl line 96.

Try:

apt-get install gperf

---------------------------------

Error:

/usr/bin/ld: cannot find -lz

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

Try: apt-get install lib32z1-dev

---------------------------------

Error:

/usr/bin/ld: cannot find -lncurses

collect2: ld returned 1 exit status

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

Try: apt-get install lib32ncurses5-dev

---------------------------------

Error:

prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: No such file or directory

compilation terminated.make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/Android/main-common.o] Error 1

Try:apt-get install libx11-dev

---------------------------------

Error:

make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/

libEGL_translator_intermediates/EglX11Api.o] Error 1

Try: apt-get install libgl1-mesa-dev

---------------------------------

Error:

bison -d  -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found

Try: apt-get install bison

---------------------------------

Error:

Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l

/bin/bash: flex: command not found

Try: apt-get install flex

---------------------------------

Error:

external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory

compilation terminated.

Try: apt-get install zlib1g-dev

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved