React-native: Question: RN 0.59.x build fails on CircleCI with exit value 137

Created on 6 May 2019  Â·  3Comments  Â·  Source: facebook/react-native

We build out app on CircleCI and until v0.57.8 it was working fine but updating to 0.59.x gives this error:

[12:45:19]: â–¸ Note: Some input files use or override a deprecated API.
[12:45:19]: â–¸ Note: Recompile with -Xlint:deprecation for details.
[12:45:19]: â–¸ > Task :react-native-svg:processReleaseJavaRes NO-SOURCE
[12:45:19]: â–¸ > Task :react-native-svg:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
[12:45:19]: â–¸ > Task :app:javaPreCompileQa
[12:45:44]: â–¸ > Task :app:bundleQaJsAndAssets
[12:45:44]: â–¸ warning: the transform cache was reset.
[12:46:00]: â–¸ Loading dependency graph, done.
[12:46:19]: â–¸ > Task :app:bundleQaJsAndAssets FAILED
[12:46:19]: â–¸ FAILURE: Build failed with an exception.
[12:46:19]: â–¸ * What went wrong:
[12:46:19]: â–¸ Execution failed for task ':app:bundleQaJsAndAssets'.
[12:46:19]: â–¸ > Process 'command 'node'' finished with non-zero exit value 137

I figure this has something to do with memory or Gradle/Java options because the build works fine on my local machine (./gradlew assembleRelease)

Useful snippets from circle config:

jobs:
  make-android:
    ...
    docker:
      - image: circleci/android:api-28-node8-alpha
    environment:
      TERM: dumb
      # JAVA_OPTS...
      # GRADLE_OPTS...
    steps:
      - checkout:
          path: *root_dir
      - attach_workspace:
          at: *root_dir
      - run:
          name: Build the app
          no_output_timeout: 30m
          command: bundle exec fastlane make

And fastlane make is

gradle(task: "clean")
gradle(task: "assembleQa")

I tried multiple JAVA_OPTS and GRADE_OPTS, including removing them (it used to work find with no _OPTS with v0.57.8)

JAVA_OPTS: "-Xms512m -Xmx4096m"
GRADLE_OPTS: -Xmx4096m -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xms512m -Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"
JAVA_OPTS: "-Xms512m -Xmx2048m"
GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"

I also have this in android/app/build.gradle

dexOptions {
    javaMaxHeapSize "2g"
    preDexLibraries false
}
Ran Commands Locked Question

Most helpful comment

@export-mike Answered here

Solution: Fixed by setting maxWorkers: <# workers> in metro.config.js.

All 3 comments


We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

👉 Click here if you want to report a reproducible bug or regression in React Native.

@sourabhv any luck on solving this issue?

@export-mike Answered here

Solution: Fixed by setting maxWorkers: <# workers> in metro.config.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazywei picture lazywei  Â·  3Comments

arunabha picture arunabha  Â·  3Comments

jlongster picture jlongster  Â·  3Comments

anchetaWern picture anchetaWern  Â·  3Comments

janmonschke picture janmonschke  Â·  3Comments