How to add multidex support when build chrome_shell_apk debug version?

204 views
Skip to first unread message

Shengbin Meng

unread,
Jun 1, 2015, 9:49:57 AM6/1/15
to chromi...@chromium.org
When I build chrome_shell_apk debug version by running the following command `~/projects/chromium/src$ ninja -C out/Debug chrome_shell_apk`, an error occured:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502) 
         ......

After googling I learned that it's caused by the "65K Limit" and can be avoided by using the multidex support (see https://developer.android.com/tools/building/multidex.html#avoid).

So how do we do that in chromium project? Is there instructions in the docs?

Yaron Friedman

unread,
Jun 1, 2015, 10:31:23 AM6/1/15
to shengb...@gmail.com, chromi...@chromium.org
I suspect this is an issue with your local build setup. The bots are compiling chrome_shell_apk without issue: http://build.chromium.org/p/chromium.linux/builders/Android%20Builder%20%28dbg%29/builds/81698

Are you adding custom libraries or gyp flags? 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Shengbin Meng

unread,
Jun 1, 2015, 10:50:01 AM6/1/15
to Yaron Friedman, chromi...@chromium.org
I did exactly as the linux build instruction says to setup. Besides, when I build release version there is no error. The difference is when I build release version, I add gyp flag “fastbuild=1” (BTW, this flag is also used by the bots, right? Someone told me that at https://groups.google.com/a/chromium.org/forum/#!mydiscussions/chromium-discuss/0IAwnW-ysXs ), and when I build debug version there is no gyp flag at all.

No custom libraries are added. I thought such a large project as Chromium would perhaps already need multidex…

---------------------------
Shengbin Meng

Shengbin Meng

unread,
Jun 1, 2015, 11:01:26 AM6/1/15
to chromi...@chromium.org, yfri...@chromium.org
I am trying to build the debug version also with "fastbuild=1" and see if it makes any difference.

Shengbin Meng

unread,
Jun 2, 2015, 4:40:33 AM6/2/15
to chromi...@chromium.org, yfri...@chromium.org
Debug build with "fastbuild=1" also resulted in the com.android.dex.DexIndexOverflowException :(

Thiago Farina

unread,
Jun 2, 2015, 9:34:33 AM6/2/15
to shengb...@gmail.com, chromi...@chromium.org, yfri...@chromium.org


On Tuesday, June 2, 2015, Shengbin Meng <shengb...@gmail.com> wrote:
Debug build with "fastbuild=1" also resulted in the com.android.dex.DexIndexOverflowException :(

I don't think you want to build with fastbuild=1. That will make not possible to debug, I think it will remove the information necessary for debugging.
 
Are you trying to build on Ubuntu? If yes, which version? What is the version of your Java?


--
Thiago Farina

Torne (Richard Coles)

unread,
Jun 2, 2015, 1:56:44 PM6/2/15
to tfa...@chromium.org, shengb...@gmail.com, chromi...@chromium.org, yfri...@chromium.org

I build with fastbuild=1 all the time and don't find it to be a real issue; you can't debug with gdb and you don't get line numbers in back traces but you still get function names and I'm okay with that, it seems to be a pretty big win in build time since you are shifting a fraction of the total number of bytes around (our debug info is really really big).

However I don't think fastbuild has any impact on Java, so it's probably not relevant either way for why you are hitting the dex limit.


Dominick Ng

unread,
Jun 2, 2015, 7:51:44 PM6/2/15
to to...@chromium.org, tfa...@chromium.org, shengb...@gmail.com, chromi...@chromium.org, yfri...@chromium.org
I'm also currently running into a DexIndexOverflow. It happens when I try to compile chrome_public_apk, chrome_shell_apk, or chrome_shell_test_apk. I'm using a gn build on Ubuntu, trying to compile the tip of the tree without any other additions. All I have in GYP_DEFINES is "OS=android".


-Dom.

Shengbin Meng

unread,
Jun 2, 2015, 9:38:37 PM6/2/15
to chromi...@chromium.org, yfri...@chromium.org, shengb...@gmail.com
Actually I indeed do not want to build with fastbuild=1. I just try to find out weather this flag has anything to do with the DexIndexOverflowException (and it turned out not).

I am using Ubuntu 14.04 LTS and Java 1.7.0_79.
Reply all
Reply to author
Forward
0 new messages