美文网首页
错误execution failed for task ':tr

错误execution failed for task ':tr

作者: 帝王鲨kingcp | 来源:发表于2018-03-21 17:00 被阅读0次

execution failed for task ':transformClassesWithDexForQsDebug'com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException
记录一下这个问题的处理方式:不小心被我碰上了,弄了好久总算解决了。也看了很多网上的解决方式。

第一种:检查jar是否重复引用

第二种:分包打包配置问题

build.gradle中

android {
...
   defaultConfig {
       ...
       multiDexEnabled true
       ...
   }
   dexOptions {
      incremental true
      maxProcessCount 4 // this is the default value
      javaMaxHeapSize "2g"
   }
...
}

在local.properties中添加

org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

第三种

很遗憾上面的两种方式都没有解决我的问题,我的解决方式是将dexOptions{}全部删除。dexOptions作用是提高分包打包的效率问题,删除没有大影响。
我的项目在编译时有如下的wranning:'android.dexOptions.incremental' property is deprecated and it has no effect on the build process

相关文章

网友评论

      本文标题:错误execution failed for task ':tr

      本文链接:https://www.haomeiwen.com/subject/csigqftx.html