DSL object for configuring dx options.
Property | Description |
additionalParameters | List of additional parameters to be passed to |
javaMaxHeapSize | Specifies the |
jumboMode | Enable jumbo mode in dx ( |
keepRuntimeAnnotatedClasses | Keep all classes with runtime annotations in the main dex in legacy multidex. |
maxProcessCount | The maximum number of concurrent processes that can be used to dex. Defaults to 4. |
optimize | Whether to run the |
preDexLibraries | Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower. |
threadCount | Number of threads to use when running dx. Defaults to 4. |
String
javaMaxHeapSize
Specifies the -Xmx
value when calling dx. Example value is "2048m"
.
Keep all classes with runtime annotations in the main dex in legacy multidex.
This is enabled by default and works around an issue that will cause the app to crash when using java.lang.reflect.Field.getDeclaredAnnotations on older android versions.
This can be disabled for for apps that do not use reflection and need more space in their main dex.
Integer
maxProcessCount
The maximum number of concurrent processes that can be used to dex. Defaults to 4.
Be aware that the number of concurrent process times the memory requirement represent the minimum amount of memory that will be used by the dx processes:
Total Memory = maxProcessCount * javaMaxHeapSize
To avoid trashing, keep these two settings appropriate for your configuration.
Boolean
optimize
Whether to run the dx
compiler with the --no-optimize
flag.
If not specified, debuggable builds will be compiled with optimizations turned off and release builds with optimizations turned on.
Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.
Integer
threadCount
Number of threads to use when running dx. Defaults to 4.