源代码编译+模块化编译

为了避免混乱,下载的源代码以版本号为包名称。如3175 下面再存放system源代码。

而且相应的应用程序要注意对应的版本,可能导致编译不通过。


源代码编译

svn checkout 地址   下载指定的源代码

cd system        cd到相应的目录下面

source  build/envsetup.sh   执行命令初始化环境

build_all.sh   全编译源代码   

编译过后的源代码,生成一个out目录。然后可以把相应文件通过软件烧到手机上,以达到升级的目的。



模块化编译

一:进行模块化编译的时候注意删除.bak文件,否则有时候可能编译不通过

如何单独编译framework模块。。。http://blog.csdn.net/brucexu1978/article/details/7610358

http://wenku.baidu.com/view/c5ec9c27dd36a32d7375815c.html

模块化编译的时候出现的问题:

1:编译录音机代码显示:
target R.java/Manifest.java: SoundRecorder (out/target/common/obj/APPS/SoundRecorder_intermediates/src/R.stamp)
aapt: warning: string 'browser' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'dialog_item_sim1' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'dialog_item_sim2' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'dialog_title' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'menu_recorder_ring' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'menu_recorder_ring_failed' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'menu_recorder_ring_success' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'menu_select_all' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
aapt: warning: string 'menu_unselect_all' has no default translation in packages/apps/SoundRecorder/res; found: bn bo ce ha my ug
packages/apps/SoundRecorder/res/layout/recording_file_item.xml:32: error: Error parsing XML: not well-formed (invalid token)
make: *** [out/target/common/obj/APPS/SoundRecorder_intermediates/src/R.stamp] Error 1

这个是xml格式有问题导致的。应该是加注释的时候引起的。

提示信息:recording_file_item.xml:32: error: Error parsing XML: not well-formed



在system里面可以下载,编译生成路劲不对。
Install: out/target/product/generic/system/app/SoundRecorder.odex
Notice file: packages/apps/SoundRecorder/NOTICE -- 

out/target/product/generic/obj/NOTICE_FILES/src//system/app/SoundRecorder.apk.txt
Install: out/target/product/generic/system/app/SoundRecorder.apk
make: Leaving directory `/home/chenpeng/520/system'
在svn/system直接不能下载。
chenpeng@eton-sw02-desktop:~/520/svn/system/packages/apps$ svn checkout 
http://192.168.0.67/svn/SPREADTRUM/SC8825/system/packages/apps/SoundRecorder -r 3125
U    SoundRecorder/Android.mk
原因 没有删除原来的源代码。
现在源代码的时候,如果停止下载。那么当你下次想要下载的时候,就会提示
chenpeng@eton-sw02-desktop:~/520/svn/system/packages/apps$ svn checkout 
http://192.168.0.67/svn/SPREADTRUM/SC8825/system/packages/apps/SoundRecorder -r 3125
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)      
源代码被锁住了


编译出现错误:

chenpeng@eton-sw02-desktop:~/520/2651/system$ mmm packages/apps/Calendar
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=sp8825eaplus
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
No private recovery resources for TARGET_DEVICE sp8825ea
make: Entering directory `/home/chenpeng/520/2651/system'
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/calendar-common_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/Calendar_intermediates/classes-full-debug.jar'.  Stop.
make: Leaving directory `/home/chenpeng/520/2651/system'

为什么???



chenpeng@eton-sw02-desktop:~/520/222/system$ mmm packages/apps/SoundRecorder
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.3
TARGET_PRODUCT=sp8825eaplus
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IML74K
============================================
No private recovery resources for TARGET_DEVICE sp8825ea
make: Entering directory `/home/chenpeng/520/222/system'
make: Nothing to be done for `all_modules'.
make: Leaving directory `/home/chenpeng/520/222/system'



全编可以通过。单独编译不行。搞死了!!!!


C:\Documents and Settings\ey>adb push D:\android-sdk\platform-tools\EyoCalendar.
apk system/app
failed to copy 'D:\android-sdk\platform-tools\EyoCalendar.apk' to 'system/app/Ey
oCalendar.apk': Read-only file system

重启生效

重启手机生效

5:putty 刚开始不支持中文,右击上面窗口,选择change settings->translation->UTF-8.更新字符编码方式。可以了。


参考链接:http://www.cnblogs.com/wanqieddy/archive/2011/06/09/2076783.html

http://wenku.baidu.com/view/15a17308763231126edb116a.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值