Skip to content

_JAVA_OPTIONS can cause builds to fail #171

@devnev

Description

@devnev

Orb version

react-native-community/[email protected]

What happened

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-mmkv:configureCMakeDebug[arm64-v8a]'.
> Picked up _JAVA_OPTIONS: -Xmx4096m -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

I initially assumed the Picked up _JAVA_OPTIONS... line here was informational, as the JVM simply outputs it on startup when the _JAVA_OPTIONS is present. But there's no other error output, so I had to dig a bit further using the stack trace, and found https://android.googlesource.com/platform/tools/base/+/ed16bbacedbae05db984c1429955429764b21af2, a very recent change to gradle to consider _JAVA_OPTIONS informational rather than an error. Removing the _JAVA_OPTIONS fixed the build.

Expected behavior

I'm not sure if this is worth fixing given the upstream gradle fix, but I also wonder if the _JAVA_OPTIONS use couldn't be replaced with having the same options in -Dorg.gradle.jvmargs, which seems to be more standard. At the very least this issue might help others resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions