In fact, a more complex solution worked for me, which combines everything from above, plus the inclusion of multidex in the build.gradle file for the module.
but. Add this line to the defaultConfig section to enable multiDex
// Enabling multidex support. multiDexEnabled true
B. Then install dexOptions , for example:
dexOptions { incremental true javaMaxHeapSize "4G" }
C. After switching to multidex and setting the heap to 4g, an overflow error may occur that will lead to me uncommenting and changing the jvmargs line from the projectβs gradle.properties file, for example:
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Values ββmay vary depending on your device. You can also use double values.
Codrut TG Aug 14 '16 at 12:19 2016-08-14 12:19
source share