Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

MultiDex: Main Dex Capacity Exceeded

$
0
0

I'm using a package I've included into my project that requires MultiDex, I've got 156561 references so I'll need multiple .dex files.

However it fails, and in the build logs cites this a crux of it's failure.

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:548)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:368)
at com.android.dx.command.dexer.Main.runDx(Main.java:289)
at com.android.dx.command.dexer.Main.main(Main.java:247)
at com.android.dx.command.Main.main(Main.java:94)

I'm not sure why the main dex capacity is exceeded if I'm using multidex.

Looking at stack overflow I find many people saying it can be fixed through

android {

    dexOptions {
        keepRuntimeAnnotatedClasses false
    }

}

Which is just another way of reducing the references via Gradle
Others suggest setting the minimum API > 21, which is already true for my project
I've also manually upgraded Proguard, as MultiDex uses it
\n
Does anyone have any suggestions as to why its complaining about the amount of classes I have, is there an upper limit to MultiDex?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>