面向設備的Android源碼編譯

使用的設備是:HTC Evo 3D X515m(GSM版),Android版本:4.0.4,編譯環境:Ubuntu 10.04(64位)

本打算使用Google提供的源碼進行編譯,但是Google提供的源碼庫中沒有htc的shooteru設備。Google可以提供的設備可以在它的源碼庫中查找:https://android.googlesource.com/, 由於國內對google的限制,使用repo sync指令下載源碼時經常會出現網絡斷開的情況。使得使用Google源碼進行特定設備的編譯變得困難。

編譯環境的配置可以具體參考:http://source.android.com/source/initializing.html

CyanogenMod(http://wiki.cyanogenmod.orghttp://www.cyanogenmod.org/)是一個基於開源Android系統,供某些手機使用的二級市場固件。相對於Google,它更關注於Android源碼在手機設備上的適配。在http://wiki.cyanogenmod.org/wiki/Building_from_source上列出了CyanogenMod可以適配的機型,並給出了從源碼編譯ROM包的步驟。但是沒有找到shooeru設備的身影,可惜。

從CyanogenMod的編譯過程看到,在git庫http://github.com/CyanogenMod下是可以找到android_device_htc_shooteru設備的https://github.com/CyanogenMod/android_device_htc_shooteru,在branch下看到shooteru設備源碼只可以在ics分支下編譯,即andorid4.0.4下。所以下載源碼時需要指定位ics版本:git://github.com/CyanogenMod/android.git -b ics。

運行repo sync指令,下載完全部源碼(大約8.7G)後,在device下並沒有htc設備的身影。可以修改.repo/manifest.xml文件加入一行:

  <project path="device/htc/shooteru" name="CyanogenMod/android_device_htc_shooteru" />

後,運行repo sync,同步之後,shooteru設備終於出現了。

運行指令

cd ~/android/cm-ics/device/htc/shooteru/
./extract-files.sh

extract-files.sh代碼的作用是從設備提取出需要的庫文件,如果有庫文件找不到的話,會在後面的編譯過程中出現錯誤,在運行過程中有兩個庫沒有找到:

remote object '/system/lib/libacdbloader.so' does not exist
remote object '/system/lib/libacdbmapper.so' does not exist

這樣的庫自己到網上搜。

一、when trying to build i get this and it stops.
make: *** No rule to make target `vendor/cm/proprietary/Term.apk', needed by `out/target/product/p1c/system/app/Term.apk'. Stop.
tried to repo sync twice and build twice to no avail.
under /vendor/cm inside of your build folder run the ./get-prebuilts script before you brunch
二、prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/shooteru/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::updateDeviceInfo(int, int):hardware/qcom/media/audio/msm8660/AudioHardware.cpp:570: error: undefined reference to 'acdb_loader_send_voice_cal'
repo sync
三、prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/shooteru/obj/SHARED_LIBRARIES/audio.primary.msm8660_intermediates/AudioHardware.o: in function android_audio_legacy::AudioHardware::enableFM(int):hardware/qcom/media/audio/msm8660/AudioHardware.cpp:2569: error: undefined reference to 'acdb_loader_send_audio_cal'
<project name="CyanogenMod/android_device_htc_msm8660-common" path="device/htc/msm8660-common" remote="github" revision="ics"/>

發佈了12 篇原創文章 · 獲贊 23 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章