build apk java heap space_Android Studio - Gradle build failing - Java Heap Space

Android Studio 2.2.3. I've been building an APK for android with my current project with success until very recently. As far as I know, nothing was changed except a data file, and my "Build APK" step mysteriously started failing with this message in the gradle console:

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':VrSamples:Native:myproject:Projects:Android:packageDebug'.

> Java heap space

and in my "messages" window I see this error:

Error:Execution failed for task ':VrSamples:Native:myproject:Projects:Android:packageDebug'.

> Java heap space

mple, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:

org.gradle.jvmargs=-Xmx1024m

Read Gradle's configuration guideRead about Java's heap size

I've tried many things:

Reset version control to previous version I know was generating APK's fine

Re-clone the entire project in a new location to rule out and intermetiate files that might be pulled in with the .gitignore, to guarantee it's a fresh build

Rebooted my computer

re-installed android studio

Run the clean step, rebuilt, manually deleted intermediate files

Added org.gradle.jvmargs=-Xmx1024m to my gradle.properties file

increased the 1024m to 4096m

manually increased the -Xmx value in both Android Studio\bin\studio.exe.vmoptions and the 64-bit equivalent

I'm puzzled as to why I'm suddenly hitting this issue now, and why I can't seem to be able to re-create the APK's I've been building without problems until recently. As far as I'm aware, I also haven't updated any libraries either.

Would appreciate any suggestions to resolve this issue, tips on how to debug this kind of thing down the road, etc.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值