Open ghost opened 6 years ago
Ok, I did some digging, and this fixes it:
export GRADLE_OPTS="-Xms1724m -Xmx5048m -Dorg.gradle.jvmargs='-Xms1724m -Xmx5048m'"
Maybe p4a could somehow make this default, without overriding it if already specified by the user? (for people who use their custom gradle settings with p4a
)
Good catch thanks! I've never seen this error before. For information, what's your distribution? If this error affects too many users we could also update the troubleshooting to begin with.
I ran it in a standard ubuntu:latest
docker image (which seems to be 18.04
right now) with gradle
and openjdk-8-jdk
as packaged for that.
It only appeared once I had a tad more dependencies and might also depend on having larger project contents (I have about 200MB of files), so I imagine it potentially affects a lot of users, but in practice only a subset with particularly big projects maybe (?)
Oh OK good to know, but weird, I remember I tried on Dockerized Ubuntu 18.04 and didn't see that specific issue. However it could be that gradle wasn't picked up in my case.
You'll probably get the 1024MB warning as well (check in your logs if you're curious, might require the debug output of p4a to be enabled) - but it only crashes if it actually runs out, which seems to require a certain project size and complexity. My earlier tests didn't crash either, but my current real world app does when packaged.
Non-gradle ant-based builds shouldn't actually work anymore, I tried those and all recent versions of Android SDKs have the required file removed (even of older SDKs, they updated them accordingly). Doesn't look like Google supports non-gradle builds these days
Oh right, I could actually add this to the options maybe. Or does this not affect anyone else? I wonder if my app is just too huge :joy:
I've seen maybe one other person hit this, I think, but it seems pretty rare. I don't see a reason not to add the proposed option though, if anyone wants to make a PR for it.
@inclement I think it'll increase the base memory footprint a little, so it's not entirely without cost
I used this build command:
p4a apk --debug --private /my-app/ --orientation user --window --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python3crystax,sdl2,pysdl2,pyjnius --arch=armeabi-v7a
It failed with a
Java heap space
error:I don't have any gradle properties or any config files, I just used the
p4a
command above - so I don't know how to fix this. Maybe,p4a
could pick a better default here on its own?