Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The build hangs at :app:bundleReleaseJsAndAssets when "./gradlew assembleRelease" is used #11696

Closed
ghprud opened this issue Jan 2, 2017 · 21 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@ghprud
Copy link

ghprud commented Jan 2, 2017

Description

[I just ran ./gradlew assembleRelease from the ../android folder. The expectation is for the build to finish, but the build hangs for indefinite amount of time and fails with FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory. This is a major blocker]

Reproduction

[In the project root folder, cd android, ./gradlew assembleRelease]

Solution

[A way to run the builds faster]

Additional Information

  • React Native version: [0.39] (I have noticed this in earlier versions too)
  • Platform: [Android]
  • Operating System: [MacOS]
@DanielMSchmidt
Copy link
Contributor

@facebook-github-bot stack-overflow

@cbpetersen
Copy link
Contributor

If you need a work around, i had issues with this as well and ended up bundling the js manually first with

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output App/src/main/assets/index.android.bundle --assets-dest App/src/main/res/

and then ignoring the gradle task with

./gradlew assembleRelease -x bundleReleaseJsAndAssets

@AndrewJack
Copy link
Contributor

You can limit the amount of React Native workers when bundling if you are having memory issues.

To set a limit add the following environment variable:

export REACT_NATIVE_MAX_WORKERS=2

http://stackoverflow.com/a/38201276

@AndrewJack
Copy link
Contributor

@facebook-github-bot answered

@facebook-github-bot
Copy link
Contributor

Closing this issue as @AndrewJack says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

@billpatterson
Copy link

This is NOT closed in the sense of "solved". I have this problem, and setting the environment variable had no effect.

@luisfcofv
Copy link

I'm having the same issue

@g33ktony
Copy link

g33ktony commented Jul 19, 2017

Same issue here on latest react-native 0.46.4 I don't have the realm files on project root
it just hangs on :app:bundleReleaseJsAndAssets I ran the command that @cbpetersen said, build succeeded but app stops when I open it

@eneskaya
Copy link

eneskaya commented Aug 4, 2017

For me this issue only appears when I have a packager instance running and try to build the app via react-native run-android.

@NicegirlA
Copy link

I have same issue like this
image

@jtewright
Copy link

jtewright commented Sep 2, 2017

Quitting the packager and react-native run-android worked for me rn 47. If it's at all helpful, it was getting stuck consistently at the same completeness, 93% in my case.

@TGPSKI
Copy link

TGPSKI commented Sep 29, 2017

Any updates? Having this issue for all 0.48.x revisions

@TGPSKI
Copy link

TGPSKI commented Oct 19, 2017

Hi, I ended up solving this issue, and turned what I learned into a medium article that addresses this and related issues.

https://medium.com/@paterw00t_17915/android-react-native-fastlane-working-with-multiple-build-types-a9a6641c5704

@SPATAN18
Copy link

Thanks, @cbpetersen, your suggestions worked with some minor changes.

@ThaJay
Copy link

ThaJay commented Dec 19, 2017

My ubuntu just freezes sometimes at
Building 92% > :app:bundleReleaseJsAndAssets
and I have to hard reboot my laptop.
(sometimes as in about 25% of times I let it build a release version)

@SPATAN18 what changes?

@LeVadim
Copy link

LeVadim commented Dec 26, 2017

Where would you set this export REACT_NATIVE_MAX_WORKERS=2 environment?
Thank you!

@jeremyeaton89
Copy link

jeremyeaton89 commented Jan 16, 2018

Noticed this problem as well after mac OSX firmware security update where my machine bugged out when booting back up (saw multiple apple icons, and other jank). Not sure what the problem is but experiencing hang on bundle[buildType]JSAndAssets.

@jeremyeaton89
Copy link

In addition, seems like i'm having issues with stuff being removed?

11:22:08.069 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:removeDanglingSymlinks (Thread[Daemon worker,5,main]) completed. Took 0.182 secs.
11:22:08.069 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:bundleStagingJsAndAssets (Thread[Daemon worker,5,main]) started.
11:22:08.070 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:bundleStagingJsAndAssets
11:22:08.070 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':app:bundleStagingJsAndAssets'
11:22:08.070 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':app:bundleStagingJsAndAssets' is up-to-date
11:22:12.279 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':app:bundleStagingJsAndAssets' (up-to-date check took 4.209 secs) due to:
  Output file /Users/jeremyeaton/projects/taskrabbit/tasker/android/app/build/intermediates/assets/staging/index.android.bundle.meta has changed.
  Output file /Users/jeremyeaton/projects/taskrabbit/tasker/android/app/build/intermediates/res/merged/staging/drawable-mdpi/app_images_pausemessage.png has been removed.
  Output file /Users/jeremyeaton/projects/taskrabbit/tasker/android/app/build/intermediates/res/merged/staging/drawable-xxhdpi/app_images_trlogologin.png has been removed.
11:22:42.843 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
11:22:42.847 [DEBUG] [org.gradle.launcher.daemon.server.health.DaemonStatus] GC rate: 0.0/s
11:22:42.848 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
11:22:42.848 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
11:22:42.851 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
> Building 97% > :app:bundleStagingJsAndAssets

@jeremyeaton89
Copy link

Looks like rm -r default.realm.* did it for me

#10078 (comment)

@saraswathirbt
Copy link

saraswathirbt commented Feb 13, 2018

fastlane hangs on
This might take a few minutes. Please don't interrupt the script
can any one please help me
fastlane -v:2.80.0

@t133
Copy link

t133 commented Feb 22, 2018

try this https://stackoverflow.com/a/48917899/3645698
maybe will work. Just check your /res/ files if all is in good situation..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests