Re: [android-building] Building seperate modules - dexpreopt mismatch

2,871 views
Skip to first unread message

Magnus Bäck

unread,
Oct 30, 2012, 11:51:11 AM10/30/12
to android-...@googlegroups.com
On Tuesday, October 30, 2012 at 02:43 PDT,
Benjamin <b74c...@gmail.com> wrote:

> 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 timeconsuming (I'm developing on a ubuntu 12.04 64bit virtual
> machine) I'd like to build seperate 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. Everytime I try to boot, the new system image won't
> boot because of (this is one of the mismatches, :
>
> I/dalvikvm( 1696): DexOpt: mismatch dep signature for '/system/framework/framework.odex'
> E/dalvikvm( 1696): /system/app/SettingsProvider.apk odex has stale dependencies
> I/dalvikvm( 1696): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory

As you've discovered, this is because of the dex pre-optimization that
makes all optimized dex code require upon the exact same copies of all
dependent jar files as when it was built.

> After some research, I tried to disable dexpreopt with the enviroment
> variables
>
> export $WITH_DEXPREOPT=false
>
> and
>
> export $DISABLE_DEXPREOPT=true

Drop the $.

export WITH_DEXPREOPT=false
export DISABLE_DEXPREOPT=true

[...]

--
Magnus Bäck
ba...@google.com

Magnus Bäck

unread,
Oct 30, 2012, 3:41:24 PM10/30/12
to android-...@googlegroups.com
On Tuesday, October 30, 2012 at 10:30 PDT,
Benjamin <b74c...@gmail.com> wrote:

> Ofcourse the $ needed to be dropped, was a typing error, excuse
> me..(just tried it again just in case, doublechecked with 'echo
> $WITH_DEXPREOPT' which indeed returned false and 'echo
> $DISABLE_DEXPREOPT' which returned true, did a 'mmm frameworks/base'
> and 'make snod', but still the "Warning: with dexpreopt enabled, you
> may need a full rebuild." warning remained..)

That's odd. You can always place something like

$(error WITH_DEXPREOPT='$(WITH_DEXPREOPT)')

close to that warning to verify exactly which value of the variable
is being picked up. This type of primitive printf-style debugging is
one of precious few methods to debug makefiles.

(The single quotes aren't necessary, but can make it easier to
distinguish between an empty string and a string containing just
a space. Makes a big difference sometimes.)

--
Magnus Bäck
ba...@google.com

Ying Wang

unread,
Oct 30, 2012, 4:22:56 PM10/30/12
to android-...@googlegroups.com
I don't think WITH_DEXPREOPT in build/target/board/generic/BoardConfig.mk can override the value you give as an environmental variable.
I remember the precedence is as:
command line makefile variable > enviromental variable > variable assignment in makefile.

On Tue, Oct 30, 2012 at 12:38 PM, Benjamin <b74c...@gmail.com> wrote:
Apparently the WITH_DEXPREOPT variable is hardcoded in build/target/board/generic/BoardConfig.mk. Changed it there and after a full clean rebuild the emulator now boots after only building modules and generating a new systemimage. 


--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

Ying Wang

unread,
Oct 30, 2012, 4:26:03 PM10/30/12
to android-...@googlegroups.com
Sorry, according to http://www.gnu.org/software/make/manual/make.html#Environment, environmental variables can be overridden with explicit assignment.
Then you can use command line makefile assignment:
$ make showcommands WITH_DEXPREOPT=false

Narasimha Aditya Gollapudi

unread,
Aug 18, 2014, 8:19:12 PM8/18/14
to android-...@googlegroups.com, ba...@google.com
I'm glad someone else also had this issue before. Thank god for this env variable fix. That helped me.
Reply all
Reply to author
Forward
0 new messages