編輯:關於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
QQ語音聊天時候,如果自己這邊不方便接聽怎麼辦,有一個辦法就是把語音給轉換成文字。首先下載最新版的手機QQ,我們以安卓為例。這個必須升級的,舊版本無法操作。
在Android Studio上將項目導入Github上: Enable Version Control Integration... 2.選擇Git,點擊
在常用的手機閱讀軟件中,我們已經習慣了閱讀時不會鎖屏,那麼在最新出來的手機閱讀APP-微信讀書中怎麼實現APP運行時自動鎖屏關閉的呢?1、打開微信讀書進入應
1、寫在前面:雖然demo中程序框架已搭建完成,但是由於筆者時間原因,暫時只完成了核心部分:多線程下載的部分,其他數據庫、服務通知、暫停部分還未添加到項目中。2、相關知識