https://kotlinlang.org logo
Title
r

raul782

03/20/2018, 2:41 AM
Hey guys, just moved over the weekend a big android project from java to kotlin. everything seems to work fine. but I'm now over 65k dex limit. I've started to investigate the issue, by trying to remove some unused libraries
g

gildor

03/20/2018, 3:33 AM
Just use multidex. It’s pretty hard in nova days be under 65k Just only appcompat about 16k methods
☝️ 2
If you want to debug it, use something like https://github.com/KeepSafe/dexcount-gradle-plugin
r

raul782

03/20/2018, 4:18 AM
cool, thanks @gildor, I managed to get down to less than 65k by removing some unused libs, and the analyzer works now.
however, I'm very close to 65k, so I'll follow your advice since I'm planning to add a couple of features that will need extra libs
btw, is there an issue to use multidex even for debug apks?
e

edwardwongtl

03/20/2018, 4:24 AM
No issue for me currently
AS said, its hard to not get over 65k limit these days, once you add more feature to it
g

gildor

03/20/2018, 6:12 AM
For debug you can use special min API level 21 (usually additional flavor, but new AS can do this automatically) , in this case will be used native multi Dex and no build time penalties
d

dan.the.man

03/22/2018, 3:51 PM
Multidex has performance implications, you should look at proguarding it before multidexing
👍 1