react-native: assembleRelease hangs at bundleReleaseJsAndAssets after creating ReactPackager
Trying to create a signed apk hangs indefinitely at 89% on the bundleReleaseJsAndAssets step, after outputting bundle: Created ReactPackager
. This is using react-native version 23, on Mac running version 10.11.4. I have the keystore generated and gradle files setup properly. I’ve tried restarting and cleaning. The following are the logs beginning at the relevant build step.
19:59:21.485 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:bundleReleaseJsAndAssets (Thread[Daemon worker,5,main]) started.
19:59:21.485 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :app:bundleReleaseJsAndAssets
19:59:21.486 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':app:bundleReleaseJsAndAssets'
19:59:21.486 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':app:bundleReleaseJsAndAssets' is up-to-date
19:59:23.369 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':app:bundleReleaseJsAndAssets' (up-to-date check took 1.883 secs) due to:
No history is available.
19:59:23.369 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':app:bundleReleaseJsAndAssets'.
19:59:23.370 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'react-native''. Working directory: /Users/andrewtoth/Workspace/rspore Command: react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output /Users/andrewtoth/Workspace/rspore/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /Users/andrewtoth/Workspace/rspore/android/app/build/intermediates/res/merged/release
19:59:23.370 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'react-native'': {PATH=/Users/andrewtoth/.nvm/versions/node/v5.9.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin, JAVA_ARCH=x86_64, MANPATH=/Users/andrewtoth/.nvm/versions/node/v5.9.0/share/man:/usr/local/share/man:/usr/share/man:/usr/local/MacGPG2/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man, JAVA_MAIN_CLASS_3043=org.gradle.wrapper.GradleWrapperMain, APP_ICON_3043=/Users/andrewtoth/Workspace/rspore/android/media/gradle.icns, APP_NAME_3043=Gradle, TERM=xterm-256color, LANG=en_CA.UTF-8, ANDROID_HOME=/Users/andrewtoth/Library/Android/sdk, LOGNAME=andrewtoth, NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist, TERM_PROGRAM_VERSION=361.1, PWD=/Users/andrewtoth/Workspace/rspore/android, XPC_SERVICE_NAME=0, NVM_CD_FLAGS=, SHELL=/usr/local/bin/bash, NVM_DIR=/Users/andrewtoth/.nvm, TERM_PROGRAM=Apple_Terminal, NVM_PATH=/Users/andrewtoth/.nvm/versions/node/v5.9.0/lib/node, OLDPWD=/Users/andrewtoth/Workspace/rspore/android, SECURITYSESSIONID=186a7, USER=andrewtoth, TMPDIR=/var/folders/rk/_130h6297tqggkt_m46j4yhr0000gn/T/, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.OAkPpQxQiA/Listeners, XPC_FLAGS=0x0, TERM_SESSION_ID=DE31D2B6-9EE3-4C6D-A01A-ADDF6F1387E0, NVM_IOJS_ORG_MIRROR=https://iojs.org/dist, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.QFoEd78Blt/Render, com.apple.java.jvmTask=CommandLine, NVM_BIN=/Users/andrewtoth/.nvm/versions/node/v5.9.0/bin, SHLVL=1, HOME=/Users/andrewtoth}
19:59:23.370 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
19:59:23.370 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'react-native'.
19:59:23.373 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
19:59:23.373 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
19:59:23.373 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'react-native''
19:59:25.804 [QUIET] [system.out] bundle: Created ReactPackager
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 11
- Comments: 61 (12 by maintainers)
I have the same problem and bundleReleaseJsAndAssets task freezes.
react-native: 0.40.0
Try this workaround -
gradlew assembleRelease --console plain
same problem on 0.42.3
Hi, I ran into this problem getting our Android app published, and ended up writing a medium article that addresses this and related issues.
https://medium.com/@paterw00t_17915/android-react-native-fastlane-working-with-multiple-build-types-a9a6641c5704
I am also facing this issue
This is fixed by downgrading to 22.2, but fails from 23.0 to 24-rc5.
I ran into this issue today and was puling my hair out for about 6 hours since morning. And finally @patwaswapnil 's comment (most probably the least helpful)
led me to figuring out what was wrong. I noticed this,
which led me to this comment and now I can assemble a release apk. 😄
Hi, I am facing this kind of problem when i am passing cd andriod && ./gradlew assembleRelease.
Cannot find entry file index in any of the roots: [“/home/…/…/ReactNative/testPermissionApp”]
:app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
In my case the issue is being introduced by
jest
. As soon as I runnpm t
the issue appears. Have to reclone the app to do away with it.@andrewtoth: Should this issue really be closed? We may have a workaround but I wouldn’t say the issue is fixed.
@andrewtoth ah ic, i only tried in
dev=true&minify=false
mode. I get the same error as you now.it’s hacky, but what works for me is changing process.env.NODE_ENV assignment to:
process.env['NODE_ENV'] = ...
(both in shim.js and wherever else you do it)
@Giszmo @andrewtoth see this fork of andrewtoth’s releaseError: https://github.com/mvayngrib/releaseError/tree/nodeify
I made a few changes, seems to work fine in the android emulator. Remember to run
npm run nodeify
afternpm install <someModule>
. If you install any modules that depend on node core shims, add the --hack flag to the rn-nodeify command in package.json. This will add browser mappings to dependencies’ package.json files (and tragically make package specific hacks for compatibility with the RN packager)For me, for our project, android stopped working not only for release versions and it took me way too long to see it is the same cause. The red screen was not very informative and mislead me but now with the latest RN it points to
adb logcat
where I see these lines:So in a way this is related to #7336