今天試着下載了android 2.3.1編譯了下,爲了愉快,選擇的是64bit 10.04.1 Ubuntu Host。
編譯起來的確很愉快,安裝必要的包之後很快就編譯好了。
Q: 老版本linux系統(如ubuntu9.1)下編譯的問題:version: GLIBC_2.11 not found
A:Google大爺預編譯的cross-compiler tool-chain需要的glibc比你係統的glibc新,因此,這些toolchain沒法正常使用。解決辦法請參見
http://fanwei51880.blog.163.com/blog/static/32406740201011311208431/
Q: 感覺SDK很奇怪,自己編譯的sdk包竟然不包含Platform package以致無法創建AVD。
A: Android Open Source Gingerbread現在未公開Android SDK Updater rev 8的源碼,而android 2.3的Platform 9是依賴於最低版本Updater 8的,所以無法看見,只需要編譯好Android SDK之後,下載一個空的Android SDK r08,把platforms目錄下的子目錄拷貝到相應目錄即可。
Q: Android Updater把我識別爲Preview版本怎麼辦?
A: 首先需要了解Android編譯系統的版本設置,然後修改如下幾個文件重新m sdk即可。
build/core/version_defaults.mk
- ####
- ifeq "" "$(PLATFORM_VERSION)"
- # This is the canonical definition of the platform version,
- # which is the version that we reveal to the end user.
- # Update this value when the platform version changes (rather
- # than overriding it somewhere else). Can be an arbitrary string.
- PLATFORM_VERSION := 2.3
- # 設置爲2.3而不是2.3.1
- endif
- ####
- ifeq "" "$(BUILD_NUMBER)"
- # BUILD_NUMBER should be set to the source control value that
- # represents the current state of the source code. E.g., a
- # perforce changelist number or a git hash. Can be an arbitrary string
- # (to allow for source control that uses something other than numbers),
- # but must be a single word and a valid file name.
- #
- # If no BUILD_NUMBER is set, create a useful "I am an engineering build
- # from this date/time" value. Make it start with a non-digit so that
- # anyone trying to parse it as an integer will probably get "0".
- # BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S)
- BUILD_NUMBER := 1
- # BUILD_NUMBER設置爲任何數字即可
- endif
build/core/build_id.mk
- ####
- # BUILD_ID is usually used to specify the branch name
- # (like "MAIN") or a branch name and a release candidate
- # (like "TC1-RC5"). It must be a single word, and is
- # capitalized by convention.
- #
- BUILD_ID := CTH01
- ####
截圖如下