Android原始碼編譯--整理

小涵發表於2015-07-03

1、android原始碼編譯與開發:問題記錄

CM9原始碼下載和編譯http://www.cnblogs.com/qianxudetianxia/archive/2012/05/27/2512447.html


補充:

問題:

Checking build tools versions...

************************************************************

You are attempting to build with the incorrect version

of java.

 

Your version is: java version "1.6.0_39".

The correct version is: 1.5.

 

Please follow the machine setup instructions at

    http://source.android.com/download

************************************************************

************************************************************

You are attempting to build with the incorrect version

of javac.

 

Your version is: javac 1.6.0_39.

The correct version is: 1.5.

 

Please follow the machine setup instructions at

    http://source.android.com/download

************************************************************

解決:

注意:這裡我要說明一下,CM9的編譯指令碼相對於官方原始碼的編譯指令碼忽略了或者說處理了一些可能出現的錯誤的地方,比如說這裡java版本的檢測,如果是open jdk的話,官方就編譯不過,其實是一樣的,只需要修改一下指令碼(build/core/main.mk),找到檢測java+javac版本的地方:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '^java .*[ "]1\.6[\. "$$]')
ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
java_version :=
endif
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: Java SE 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info ************************************************************)
#$(error stop) //如果確定已經安裝正確的jdk的話,這句去掉,讓編譯繼續
endif


2、Android原始碼mm模組編譯 & mm編譯apk


3、Android系統許可權和root許可權

相關文章