Xamarin.Forms Java.exe exited with code 1

I've seen a few people encounter this issue with the heap size, which seems to be the issue in my case:

2> Could not reserve enough space for 1048576KB object heap (TaskId:336)

I tried manually setting it to 1G, got the same error, realised the space required is actually greater than 1G (it's about 1.04GB), so I set it to 2G. But this just escalated the error:

1>  Could not reserve enough space for 2097152KB object heap (TaskId:305)

I thought I'd go nuclear and just set it to 10G, but then I got a different error saying it failed to create the Java VM.

In all honesty, I don't actually know what these mean, I'm just following along based on research of SO and Xamarin Forums posts. Can anyone explain to me why I'm seeing these errors and how I can fix them?

Notes based on other questions: It's on debug, not release, and I don't have ProGuard ticked.


  • stemadostemado Member ✭✭✭
    Have you tried enabling (checking) Multi-Dex?
  • MattGoldmanMattGoldman USMember ✭✭

    No, not sure what Multi-Dex is. I have changed the Java SDK path to explicitly point to x64 and that seems to work now with the heap size set to 5G.

Sign In or Register to comment.