20000 Dex References?!


#1

We’re investigating Intercom for use within our platform. Currently we have a web portal and then a react-native implementation that spans both iOS & Android. Setting up iOS was a breeze, and I appreciate how nice the intercom interface looks. Go to set up Android, and BOOM “Cannot fit requested classes in a single dex file”.
Digging a little further, I setup an empty react-native project (admittedly, that takes you to 30,500 references off the bat), add just Intercom’s SDK, and you end up at a whopping 50,000 references. The limit is 65,536, so at that point, it’s pretty easy to see that Intercom + React Native takes you into the Multidex land.
Yes, I’ve looked at proguard and attempting to shrink those, but there’s no simple way to do it (like just turning on minifyEnabled).
So this is my appeal to the devs at Intercom, and the community that has been using their SDK for longer. I realize that asking for React Native support is probably out of the realm of present possibility. Is there any way to “carve” up Intercom’s SDK (thinking about AWS & Firebase here, if there is a “Core” SDK that would allow me to do the basics, create my own UI integrated into the app, it would save a lot of frustration & improve app performance).
Thanks for considering. Comments on anything I’m missing are much appreciated.


#2

Hey @woody – you may have already found your answer elsewhere but I’ll mention this thread to some of our mobile team to see if they have anything to add.


#3

Thanks @jeff I didn’t see anything obvious. After some time in the ecosystem, I see how I could implement my own using the API you guys make available. I guess it would be nice to have an in-between, or as mentioned, a react-native implementation. For the time being, we bit the bullet and just went multi-dex.


#4

Thanks for letting me know @woody. Something for us to keep in mind for the future.


#5

I already tried to shrink it because I got the same error but wihtout success, I believe the issue is that you propose this for proguard:

-keep class io.intercom.android. { *; }
-keep class com.intercom.
{ *; }

Which means keep all of this, even if Im not using all of the features.

Maybe you can take a look to see what is needed to keep if you are using Push notifcations or Authentication or others…


#6

Another thing that is related is Glide vs Picasso