Error:Execution failed for task ':app:transformClassesWithDexForDebug

参与了一个新的项目,代码down下来一直RUN不起来,但是同事是可以的,搞了一整天啊,差点崩溃。

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException



 To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 2560 MB (based on the dexOptions.javaMaxHeapSize = 2g).
To do this set org.gradle.jvmargs=-Xmx2560M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException


刚开始一直报上面的错,加大了org.gradle.jvmargs=-Xmx1024m,然后报了

Basho 9:48:19
Error:Failed to complete Gradle execution.


Cause:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0


上面的错,翻遍网上的解决方法都没有用,后来去看了任务管理器,发现我的jdk是32位的.....其实我发现这个问题的时候又去下了一个最新的JDK,但是不知道为什么它用的还是原来32位的,然后把两个JDK都卸载了,重新装了,打开AS,出现下面这个图


这个时候去android studio 安装路径下重启AS,然后问题解决了。
因为这个问题真的搞了好久,所以记录一下。
当碰到他提示跟Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0这个有关时,要好好看看你的JDK有没有问题,是不是64的,别是32位的,就扑街了。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值