问题:Android studio 打包是报错
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list E:\studio_mywork6\HarmlessManageSys\app\build\intermediates\multi-dex\release\maindexlist.txt --output E:\studio_mywork6\HarmlessManageSys\app\build\intermediates\transforms\dex\release\0 --min-sdk-version 19 E:\studio_mywork6\HarmlessManageSys\app\build\intermediates\transforms\jarMerging\release\0.jar}
解决方法:
一、dex文件分包
1、defaultConfig { multiDexEnabled true } 2、dexOptions { //Warning:The `android.dexOptions.incremental` property is deprecated // and it has no effect on the build process. javaMaxHeapSize "4g" preDexLibraries = false }
3、compile 'com.android.support:multidex:1.0.3'
4、App extends MultiDexApplication
二、看是否 gradle.properties 文件缺失
三、gradle.properties里配置
org.gradle.jvmargs 的大小问题