您的位置:首页 > 移动开发 > Android开发

面向设备的Android源码编译

2012-11-30 10:34 417 查看
使用的设备是: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"/>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: