編譯步驟
1)切換到下載你的sprdroid源代碼目錄
$cd xxxxx #xxxx源代碼所在地方
2)添加必要的環(huán)境變量
$source bulid/envsetup.sh #注意每次切換都需執(zhí)行此命令松靡,否則进宝,可能導致出現(xiàn)編譯找#不到規(guī)則等問題
3)選擇編譯系統(tǒng)版本
$lunch
4)安裝kernel header給android編譯
$kheader
5)編譯
make -j4全編,容易出錯,一般會只編譯某部分
make bootimage -j4編譯鏡像
make bootloader -j4編譯bootloader
6)在out/target/product/****/目錄下出現(xiàn)boot.img挡爵、system.img存崖、userdata.img等鏡像
編譯問題1
編譯出現(xiàn):MODULE.TARGET.APPS.TvQuickSettings already defined by packages/apps/TvSettings/QuickSettings
下載的源碼有問題,定位指定的位置發(fā)現(xiàn)由于存在重復文件導致的匀们,刪除相關文件惭载,得到解決!
編譯問題2
Try increasing heap size with java option '-Xmx
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server
編譯問題3
jack-server服務器無法啟動
FAILED: setup-jack-server
Jack server installation not found
No Jack server running. Try ‘jack-admin start-server’
No Jack server running. Try ‘jack-admin start-server’
Jack server failed to (re)start, try ‘jack-diagnose’ or see Jack server log
解決方法:
$ cd
$ sudo mount -o username=ubuntu,password=12cdCD //10.0.1.120/UBTSWCenter /mnt
$ sh /mnt/Ubuntu/1404Ubuntu/jack-server.sh
然后可以進行正常編譯
編譯問題4
vendor/sprd/proprietories-source/autotest/Android.mk: error: autotest (EXECUTABLES android-arm) missing libwpa_client (SHARED_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
vendor/sprd/proprietories-source/factorytest/Android.mk: error: factorytest (EXECUTABLES android-arm) missing libwpa_client (SHARED_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
解決方法:
rm? vendor/sprd/proprietories-source/autotest/Android.mk vendor/sprd/proprietories-source/factorytest/Android.mk
最后附上Java8的安裝
使用ppa/源方式安裝java8
1.添加ppa
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
2.安裝Oracle-java-installer
jdk7
sudo apt-get install oracle-java7-installer
jdk8
sudo apt-get install oracle-java8-installer
安裝器會提示你同意 oracle 的服務條款,選擇 ok
然后選擇yes 即可
如果你懶,不想自己手動點擊.也可以加入下面的這條命令,默認同意條款:
JDK7 默認選擇條款
echo oracle-java7-installer shared/accepted-oracle-license-v1-1
select true
|
sudo /usr/bin/debconf-set-selections
JDK8 默認選擇條款
echo oracle-java8-installer shared/accepted-oracle-license-v1-1
select true | sudo /usr/bin/debconf-set-selections
接下會是等待(依個人網(wǎng)速定)
如果你因為防火墻或者其他原因,導致installer 下載速度很慢,可以中斷操作.然后下載好相應jdk的tar.gz 包,放在:
/var/cache/oracle-jdk7-installer? ? ? ? ? ?? (jdk7)
/var/cache/oracle-jdk8-installer? ? ? ? ? ? ? (jdk8)
下面,然后安裝一次installer. installer 則會默認使用 你下載的tar.gz包
3.設置系統(tǒng)默認jdk
JDk7
sudo update-java-alternatives -s java-7-oracle
JDK8
sudo update-java-alternatives -s java-8-oracle
如果即安裝了jdk7,又安裝了jdk8,要實現(xiàn)兩者的切換,可以:
jdk8 切換到jdk7
sudo update-java-alternatives -s java-7-oracle
jdk7 切換到jdk8
sudo
update-java-alternatives -s java-8-oracle
4.測試jdk 是是否安裝成功:
java -version
javac -version
Try increasing heap size with java option '-Xmx