Status of incremental dexing

862 views
Skip to first unread message

Charlie Groves

unread,
Mar 30, 2012, 12:22:06 PM3/30/12
to android...@googlegroups.com
Hello,

A few weeks ago, I made a fix to the incremental dexing code(https://android-review.googlesource.com/#/c/34010/) to keep it from blowing up when running on the .dex files generated by my project. I just got back to hooking incremental dexing into my workflow yesterday, and hit an error from dexopt as soon as I tried to run the incrementally updated dexes: '"Can't byte swap: bad dex version". 

Moving the time for dexing down to 2 seconds from 30 is valuable enough to me that I can keep plugging on getting it to work. However, before I delve too deep, it'd be nice to know how far along it is. Is there a list of tasks somewhere? Was left incomplete because someone discovered a fundamental problem in incremental dexing? The incremental code looks complete despite it failing in two different ways immediately.

Thanks,
Charlie

Jesse Wilson

unread,
Mar 30, 2012, 3:05:23 PM3/30/12
to android...@googlegroups.com
Charlie,

Thanks for the fix.

I ran the latest code against a large test suite (merge using each .dex in an Android platform build) and unfortunately the latest code still includes two crashes. I'll investigate these this week; hopefully that's the last of the crashes. It's taken a long time to iron out the bugs because I underestimated how aggressively 'dx' was at deduplicating data, and this caused the app's size estimations to be incorrect.

I'm seeing crashes of two forms:
com.android.dx.util.DexException: Section limit 3548908 exceeded by string data
at com.android.dx.io.DexBuffer$Section.ensureCapacity(DexBuffer.java:542)
com.android.dx.util.DexException: Section limit 4432312 exceeded by annotation
at com.android.dx.io.DexBuffer$Section.ensureCapacity(DexBuffer.java:542)

Once I get these taken care of I'll check to make sure the emitted .dex file is well formed. And once that's working I'll talk with the Android SDK team to make incremental compilation a regular part of the build toolchain.

Cheers,
Jesse

Charlie Groves

unread,
Mar 31, 2012, 11:37:21 PM3/31/12
to android...@googlegroups.com
Hi Jesse,

That sounds great! I wasn't even attempting to prod anyone into working on this, so this is way better than I was expecting. I'm sure you'll be able to figure this out way more quickly than I would have.

Let me know if there's anything I can do to help it along,
Charlie

Brian Carlstrom

unread,
Oct 1, 2012, 1:29:39 PM10/1/12
to android...@googlegroups.com
On Sat, Sep 29, 2012 at 3:14 PM, Zach Oakes <zso...@gmail.com> wrote:
> I have an Android project with 700+ Java files, and it has been dexing for
> almost 48 hours now.

Does this sound right to people? I don't work on app development, but
I dx the libcore project (/system/framework/core.jar) all day long and
I complain that takes a minute. it has 1500+ .java files.

-bri

> If anyone could tell me the current status of
> incremental dexing in the SDK, I would be...grateful.
>
> On Friday, March 30, 2012 12:22:06 PM UTC-4, Charlie Groves wrote:
>>
> --
>
>
>
Reply all
Reply to author
Forward
0 new messages