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
Can you try running the 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 manually and see what's happening?
Running with --verbose gives me this:
ReactNativePackager:SocketClient connecting to +0ms /var/folders/rk/_130h6297tqggkt_m46j4yhr0000gn/T/react-packager-51137fab88b20c4d45b8a657f93d9f23
bundle: Created ReactPackager
Still hangs indefinitely. Is there anything I can do to get more information?
cc @davidaurelio @martinbigio
I am experiencing the same issue on Windows 10.
Trace here:
C:\Users\ma1069\rn\Test1\android>gradlew assembleRelease
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0231Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
:app:bundleReleaseJsAndAssets
bundle: Created ReactPackager
> Building 63% > :app:bundleReleaseJsAndAssets
@satya164 I have a similar output when running your command:
C:\Users\ma1069\rn\Test1>react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android\app\build\intermediates\assets\release\index.android.bundle --assets-dest android\app\build\intermediates\res\merged\release --verbose
ReactNativePackager:SocketClient connecting to +0ms \\.\pipe\C:\Users\ma1069\AppData\Local\Temp\react-packager-be8ba2d544af799f2cbe7bc25f48b1db
bundle: Created ReactPackager
notes: I have no idea about what the problem is, but this problem seems to occur both on v0.23.1 and the previous release...
Same problem on OS X.
Igors-Mac-mini:android igorsousa$ ./gradlew assembleRelease
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0231Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
Building 63% > :app:bundleReleaseJsAndAssets
Hangs indefinitely.
This is fixed by downgrading to 22.2, but fails from 23.0 to 24-rc5.
Weird thing: I created a new project with v0.23.1 on the same device giving the issue before, and now everything is working perfectly!
Has it already been solved? O_o
This issue is tagged "needs more info". Having same issue on Linux with 0.24.1. What info is needed?
Update: Here, downgrading to 0.22.2 doesn't fix it like it did for @andrewtoth .
Could anybody share a repo / gist with a ready-made reproducible setup? I鈥檒l try to dig into it.
I'm stracing it. $ strace -f -o s.trace ./gradlew assembleRelease and get tons of connection timed out.
Got to go but when I kill it, this is the last lines:
15729 madvise(0x7f0e877d3000, 1028096, MADV_DONTNEED <unfinished ...>
16398 futex(0x7f0ec0326580, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
15729 <... madvise resumed> ) = 0
16398 <... futex resumed> ) = 1
15729 _exit(0) = ?
15724 <... futex resumed> ) = 0
16398 futex(0x7f0eb8078754, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f0eb8078750, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...>
15729 +++ exited with 0 +++
15724 mmap(0x7f0e981bf000, 12288, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0 <unfinished ...>
16398 <... futex resumed> ) = 1
15724 <... mmap resumed> ) = 0x7f0e981bf000
15721 <... futex resumed> ) = 0
16398 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
15724 rt_sigprocmask(SIG_SETMASK, [QUIT], <unfinished ...>
15721 futex(0x7f0eb8078728, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
16398 <... futex resumed> ) = 0
15724 <... rt_sigprocmask resumed> NULL, 8) = 0
15721 <... futex resumed> ) = -1 EAGAIN (Resource temporarily unavailable)
16398 futex(0x7f0e80002054, FUTEX_WAIT_PRIVATE, 5, NULL <unfinished ...>
15724 madvise(0x7f0e981bf000, 1028096, MADV_DONTNEED <unfinished ...>
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
15724 <... madvise resumed> ) = 0
15721 <... futex resumed> ) = 0
15724 _exit(0) = ?
15721 mprotect(0x7f0ec0f52000, 4096, PROT_READ <unfinished ...>
15724 +++ exited with 0 +++
15721 <... mprotect resumed> ) = 0
15721 mprotect(0x7f0ec0f52000, 4096, PROT_READ|PROT_WRITE) = 0
15721 mprotect(0x7f0ec0f53000, 4096, PROT_NONE) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 3, {31723, 869650933}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 879853429}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 890100723}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 900309431}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 910513853}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 920722729}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 930928791}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 945324593}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 955531614}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 965743529}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 975940224}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 986150479}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31723, 996358141}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 6561380}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 16801116}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 26959933}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 37182244}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 47393192}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 57599051}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 68168060}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 78446842}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 89002891}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 99208753}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 109830238}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 120139041}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 130431480}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 140959220}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 151537588}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 162082851}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 172301988}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 futex(0x7f0eb8078754, FUTEX_WAIT_BITSET_PRIVATE, 1, {31724, 182891199}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
15721 futex(0x7f0eb8078728, FUTEX_WAKE_PRIVATE, 1) = 0
15721 unlink("/tmp/hsperfdata_leo/15709") = 0
15721 exit_group(130) = ?
15734 +++ exited with 130 +++
15733 +++ exited with 130 +++
16398 +++ exited with 130 +++
15728 +++ exited with 130 +++
15727 +++ exited with 130 +++
15726 +++ exited with 130 +++
15725 +++ exited with 130 +++
15723 +++ exited with 130 +++
15722 +++ exited with 130 +++
15721 +++ exited with 130 +++
15720 +++ exited with 130 +++
15719 +++ exited with 130 +++
15717 +++ exited with 130 +++
15716 +++ exited with 130 +++
15718 +++ exited with 130 +++
15709 +++ exited with 130 +++
Here is the full strace.
@davidaurelio and @satya164 could you please let me know if this information is helpful or if I could provide more insight into this bug that affects several people, including my build server where Andrew's "fix" doesn't fix it.
@davidaurelio @satya164 Here are exact steps to reproduce:
git clone [email protected]:andrewtoth/releaseError.git
cd releaseError
npm install
cd android
./gradlew assembleRelease
trying to reproduce steps provided by @andrewtoth in a well defined docker environment:
docker run -it peterlazar1993/react-native-android bash
git clone https://github.com/andrewtoth/releaseError.git
npm i -g rn-nodeify
cd releaseError/
npm install
cd android
echo "y" | android update sdk -a --no-ui --filter build-tools-23.0.1,extra-android-support,extra-android-m2repository,extra-google-google_play_services,extra-google-m2repository
./gradlew assembleRelease
I get some weird errors but also the freezing behavior at > Building 63% > :app:bundleReleaseJsAndAssets.
The errors are:
[10:55:08 PM] <END> Building Dependency Graph (11771ms)
/opt/releaseError/node_modules/babel-core/lib/transformation/file/index.js:614
throw err;
^
TypeError: /opt/releaseError/shim.js: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "StringLiteral"
...
/opt/releaseError/node_modules/babel-core/lib/transformation/file/index.js:614
throw err;
^
...
[node-haste] Encountered an error while persisting cache:
> Error: Uncaught error in the transformer worker: /opt/releaseError/node_modules/react-native/packager/transformer.js
> at index.js:109:33
> at tryCallOne (/opt/releaseError/node_modules/promise/lib/core.js:37:12)
> at /opt/releaseError/node_modules/promise/lib/core.js:123:15
> at flush (/opt/releaseError/node_modules/asap/raw.js:50:29)
> at nextTickCallbackWith0Args (node.js:433:9)
> at process._tickCallback (node.js:362:13)
@Giszmo These errors show up when I upgraded to 0.25.0-rc. The build step still hangs, just no longer after creating ReactPackager.
So I've narrowed it down pretty well. You can see a project that breaks at https://github.com/andrewtoth/releaseError. I've tried it with 24.1, 25.0-rc, and 26.0-rc. To reproduce yourself, just run react-native init projectName, add https://raw.githubusercontent.com/mvayngrib/rn-nodeify/master/shims.js to the project, and then in index.android.js add require('./shim'); to the top of the file. Running (cd android && ./gradlew assembleRelease) will break or hang on bundleReleaseJsAndAssets, depending on the version you use.
@satya164 I don't think this should be tagged as needs more information at this point.
I don't know if it has any side effect down the road but this work for me.
In android/build.gradle, replace
classpath 'com.android.tools.build:gradle:1.3.1'
with
classpath 'com.android.tools.build:gradle:1.5.0'
and the build run to finish.
@andrewtoth small correction, you shouldn't be adding shims.js from the rn-nodeify repo. rn-nodeify will create a file called shim.js in your project. Require that file at the top.
@andrewtoth @Giszmo i haven't tested rn-nodeify with the latest react-native, nor have i tested it with android, but check out adexample for an example with an older version
@mvayngrib with that adexample I get my own special issues.
git clone https://github.com/mvayngrib/adexample.git
cd adexample/
npm install
react-native android
react-native run-android # this actually does install an apk
react-native start # this gives me issues
cat /proc/sys/fs/inotify/max_user_watches # 64k
sudo sysctl fs.inotify.max_user_watches=500000
watchman shutdown-server
react-native start # watchman times out
cd android
./gradlew assembleRelease # takes ages at :app:bundleReleaseJsAndAssets but finally gets to "BUILD SUCCESSFUL"
@Giszmo i'm using npm 2.14, you?
@mvayngrib
$ npm --version
2.15.1
and on the docker it's 3.3.12.
@mvayngrib I know the process is to add the shim.js that is generated, but for my example that's all you have to do. You don't have to run rn-nodeify. Just requiring that shim.js in the default template project causes the release build to fail for android. Requiring valid js files in the project should not cause release builds to crash.
@andrewtoth i see, so it might not be a problem with rn-nodeify
@mvayngrib I brought the issue over, as I'm pretty sure it's a problem with the shim.js which is rn-nodeify, right?
@Giszmo shim.js only requires process and buffer, so i'm not sure what could go wrong there.
btw, if you're running rn-nodeify --install without specifying which shims to install, it installs all of them. You then need to link any native libraries if you're using them.
@mvayngrib I've narrowed down the error even more now. The line process.env.NODE_ENV = 'development'; breaks the babel transformer. It gives the error Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "StringLiteral", similarly to this issue #6063.
@andrewtoth interesting. I don't have the bandwidth to investigate it at the moment, but if no one does in the next few days, i'll give it a whack
@mvayngrib it would really be appreciated if you could look into this. I'm surprised to not see more people asking for it, as the way I see it, all projects using rn-ndeify with Android should have a blocker right there. Do they all use iOS only?
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:
E/ReactNativeJS(22552): Error: undefined is not a function (evaluating 'babelHelpers.typeof(global)'), stack:
E/ReactNativeJS(22552): http://192.168.0.4:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:26062:61
E/ReactNativeJS(22552): loadModuleImplementation@http://192.168.0.4:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false:105:8
So in a way this is related to #7336
@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 after npm 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)
@mvayngrib @Giszmo I get the same issue with your fork. I ran the following commands:
git clone [email protected]:mvayngrib/releaseError
cd releaseError/
git checkout nodeify
npm install
(cd android/ && ./gradlew assembleRelease)
Build fails with same error: TypeError: /Users/andrewtoth/Workspace/releaseError/index.android.js: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "StringLiteral"
@mvayngrib Also, this doesn't need to run in the Android emulator. You can already do that successfully with react-native run-android. The issue we are having is when the code is being minimized any line that tries to assign to process.env.NODE_ENV causes babel to throw. This only happens in release builds, because debug builds are not minimized.
@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)
@mvayngrib thanks that works!
@andrewtoth: Should this issue really be closed? We may have a workaround but I wouldn't say the issue is fixed.
So I got this same error. I started the project with the latest version of everything in January 2017... I changed it to com.android.tools.build:gradle:1.5.0 (thanks @jjchula) and it now works
@andrewtoth - has this issue been fixed?
My dependencies are
"react": "15.4.2",
"react-native": "0.40.0",
@mvayngrib @Giszmo
Changing to com.android.tools.build:gradle:1.5.0 did not work for me. The only work-around I have found so far is rebooting the computer :(
I have the same problem and bundleReleaseJsAndAssets task freezes.
react-native: 0.40.0
Also faced this issue when run assembleRelease task in vscode terminal. However starting the task from Android Studio 'Gradle projects' tab somehow fixed it in my case.
same problem on 0.42.3
I too getting same error
+1
same problem on rhel7
Try this workaround -
gradlew assembleRelease --console plain
@patwaswapnil the --console plain does change visible output in terminal, but has no effect on the actual issue for me. It still hangs indefinitely at the :app:bundleReleaseJsAndAssets step.
Similar issue on my project. I have two projects one works fine but one freezes. No errors no warnings.
This worked for me: gradlew assembleRelease --console plain
After some minutes, it finally finish building the release apk
@medisoft Didn't work for me. Waited for an hour no progress.
@Kabangi, which platform you are using? I got it working on windows 10.
Am using macOS 10. Just got it working. Basicallly I deleted my local repo and clone it again. Have no idea why that works.
What did you do to make it work?
In my case the issue is being introduced by jest. As soon as I run npm t the issue appears. Have to reclone the app to do away with it.
Facing this issue on "react-native": "0.46.0", , it's irritating now
I am also facing this issue
Failed to capture snapshot of input files for task 'bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file '/Users/johnfrancis/Projects/tyron/tyron/metro-bundler-symbolicate11781-20752-6dibhc.l9v1w.sock'.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task 'bundleReleaseJsAndAssets' property '$1' during up-to-date check.
at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:89)
at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.<init>(AbstractNamedFileSnapshotTaskStateChanges.java:54)
at org.gradle.api.internal.changedetection.rules.InputFilesTaskStateChanges.<init>(InputFilesTaskStateChanges.java:28)
at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:55)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:164)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:79)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.UncheckedIOException: Failed to create MD5 hash for file '/Users/johnfrancis/Projects/tyron/tyron/metro-bundler-symbolicate11781-20752-6dibhc.l9v1w.sock'.
at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:48)
at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:79)
at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:68)
at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:60)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:97)
at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:87)
... 74 more
Caused by: java.io.FileNotFoundException: /Users/johnfrancis/Projects/tyron/tyron/metro-bundler-symbolicate11781-20752-6dibhc.l9v1w.sock (Operation not supported on socket)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:126)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:116)
at com.google.common.io.ByteSource.copyTo(ByteSource.java:234)
at com.google.common.io.Files.copy(Files.java:423)
at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:45)
... 79 more
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
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.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'node'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
When the gradle build hangs, it is often due to an insufficient amount of heap memory. Edit android/gradle.properties and make sure the line org.gradle.jvmargs= line is not commented and contains something like -Xmx2048m or even more, depending on your app.
While it's building, check with ps | grep gradle if the -Xmx...setting is in effect.
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)
Try this workaround -
gradlew assembleRelease --console plain
led me to figuring out what was wrong.
I noticed this,
:app:processReleaseResources/Users/janithar/Desktop/Repos/mobile_react_native/ProfessionalApp/android/app/build/intermediates/res/merged/release/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file..
error: failed parsing overlays.
which led me to this comment and now I can assemble a release apk. :D
For anyone facing this issue, what I did was removed the node_modules folder and ran npm install.
Most helpful comment
I have the same problem and bundleReleaseJsAndAssets task freezes.
react-native: 0.40.0