Android 2.3編譯SDK問題詳解

 今天試着下載了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

  1. #### 
  2. ifeq "" "$(PLATFORM_VERSION)" 
  3.   # This is the canonical definition of the platform version, 
  4.   # which is the version that we reveal to the end user
  5.   # Update this value when the platform version changes (rather 
  6.   # than overriding it somewhere else).  Can be an arbitrary string. 
  7.   PLATFORM_VERSION := 2.3 
  8. # 設置爲2.3而不是2.3.1 
  9. endif 
  10. #### 
  11.  
  12. ifeq "" "$(BUILD_NUMBER)" 
  13.   # BUILD_NUMBER should be set to the source control value that 
  14.   # represents the current state of the source code.  E.g., a 
  15.   # perforce changelist number or a git hash.  Can be an arbitrary string 
  16.   # (to allow for source control that uses something other than numbers), 
  17.   # but must be a single word and a valid file name
  18.   # 
  19.   # If no BUILD_NUMBER is setcreate a useful "I am an engineering build 
  20.   # from this date/time" value.  Make it start with a non-digit so that 
  21.   # anyone trying to parse it as an integer will probably get "0"
  22. #  BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S) 
  23.   BUILD_NUMBER := 1 
  24. # BUILD_NUMBER設置爲任何數字即可 
  25. endif 

build/core/build_id.mk

  1. #### 
  2. # BUILD_ID is usually used to specify the branch name 
  3. # (like "MAIN"or a branch name and a release candidate 
  4. # (like "TC1-RC5").  It must be a single word, and is 
  5. # capitalized by convention. 
  6. BUILD_ID := CTH01 
  7. #### 

截圖如下

Customed Android Version

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章