Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build daemon disappeared unexpectedly in CircleCI

I use react-native on android. Everything was fine until I upgraded to latest version (0.59.4).

The build keeps failing with "Gradle build daemon disappeared unexpectedly" error on CircleCI. It works fine on local.

I know it's a memory issue and have tried multiple ways to set the java opts and stuff.

environment:
      _JAVA_OPTIONS: '-Xms512m -Xmx3g'
      GRADLE_OPTS: '-Xmx3g -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError"'

Also tried with setting in gradle.properties. None of it is working.

like image 721
Hannan Shaik Avatar asked Nov 06 '22 16:11

Hannan Shaik


1 Answers

For all those people who are still facing this. I split my build step into 2 parts.

  1. Bundle the JS Assets

./gradlew bundleReleaseJsAndAssets

  1. Build the app excluding the previous step.

./gradlew assembleRelease -x bundleReleaseJsAndAssets

With these 2 things the Circle CI building worked fine.

like image 96
Hannan Shaik Avatar answered Nov 14 '22 00:11

Hannan Shaik