Build APK: Errors while building APK. You can find the errors in the 'Messages' view

Android 在build和clean的时候正常,但是在buildapk和signedapk 和runAPk的时候出现以下错误
Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Translation has been interrupted
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

在经过无数次百度之后,终于找到一个相似的错误,问题原因是,在构建build.gradle的时候ExecutionException内存不足导致的,

解决办法:在build.gradle里面的Android下面添加,这将增加DEX操作的最大堆大小
  dexOptions {
    javaMaxHeapSize“4G”
}

可参考:[http://www.it1352.com/189062.html]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值