Building separate Android modules with dexpreopt disabled

一笑奈何 提交于 2019-12-20 10:57:54

问题


For my thesis, I'm modifying the android framework and building the source (4.1.1 Jelly Bean). I can do a full build, but because this is very time consuming (I'm developing on a ubuntu 12.04 64bit virtual machine) I'd like to build separate modules.

For example: When doing changes to the location modules, it should be possible to just build the changed module, and make a new system image:

mmm frameworks/base
make snod

But this doesn't work. Every time I try to boot, the new system image won't boot because of:

I/dalvikvm( 1696): DexOpt: mismatch dep signature for '/system/framework/framework.odex'

After some research, I tried to disable dexpreopt with the enviroment variables

export $WITH_DEXPREOPT=false 

and

export $DISABLE_DEXPREOPT=true 

and doing a full rebuild with 'make installclean'. The full rebuild works, and the changes to the framework are present in the build. But after doing a new change, still 'mmm frameworks/base' and 'make snod' result in dexpreopt mismatch.

The build/core/makefile from 'make snod' also gives the warning: 'Warning: with dexpreopt enabled, you may need a full rebuild.', which comes from this line in the makefile:

ifeq (true,$(WITH_DEXPREOPT))
$(warning Warning: with dexpreopt enabled, you may need a full rebuild.)
endif

This leads me to believe the $WITH_DEXPREOPT variable isn't correctly set or read? So far I haven't been able to get a bootable system image without doing a clean full rebuild. Is the procedure I follow the correct to disable dexpreopt, or are there any other ways to build separate modules after doing changes to the framework and getting a new system image?

Build target is 'full-eng'.


回答1:


Apparently the WITH_DEXPREOPT environment variable is overwritten by an internal WITH_DEXPREOPT variable in

build/target/board/generic/BoardConfig.mk

Changing this to false, or according to the people at google groups, starting a make with:

make showcommands WITH_DEXPREOPT=false

does the trick. Building a specific module and making a new system image now results in a bootable build.

(source: https://groups.google.com/d/topic/android-building/vJCkg8Yq9Ic/discussion )



来源:https://stackoverflow.com/questions/13135844/building-separate-android-modules-with-dexpreopt-disabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!