:app:recordFilesBeforeBundleCommandDebug FAILED
I get the following error message when running 'react-native run-android', and cannot get more detailed information even with --stacktrace, --info or --debug options.
:app:recordFilesBeforeBundleCommandDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
> A problem occurred starting process 'command 'node''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.042 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Seems it cannot find node in your path. Is your path setup correctly?
Yes of course. It succeeds, sometimes.
2016-04-17 5:02 GMT+08:00 Satyajit Sahoo [email protected]:
Seems it cannot find node in your path. Is your path setup correctly?
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/facebook/react-native/issues/6875#issuecomment-210901067
I've got the same issue. I don't think it's related to React Native or in this case Code Push, it's gradle not finding node in the path. Putting the absolute path (/usr/local/bin/node on install with Homebrew) fixes the issue for now, I'll try to find something perennial.
I've seen this too - similar to @anderson916 in that it's by no means 100% failing. My workaround is to run ./gradlew --stop (which stops the daemon)
@seeligd it works,thank you!
@seeligd you're the man
@seeligd Thank you. But Why?
Is this related to NVM perhaps? I'm definitely using NVM, and I've seen this issue as well.
Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/apprecordfilesbeforebundlecommanddebug-failed
Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.
Hi! Still experiencing this issue right now, even after running ./gradlew --stop as suggested multiple times. Any ideas?
By changing node executable path in build.gradle(app) works for me.
project.ext.react = [
nodeExecutableAndArgs : ["/usr/local/bin/node"]
];
@cskaynar good!
./gradlew --stop or simply you can close your Android Studio
Still experiencing this issue right now, even after running ./gradlew --stop as suggested multiple times.
My project is native with react native. My Environment : android studio : 3.0 beta gradle plugin : 3.0.0-beta7 gradle wrapper: gradle-4.1-all.zip Any ideas?
2017-10-27, I updated my android studio to 3.0 stable version , but still experiencing this issue.
Execution failed for task ':app:recordFilesBeforeBundleCommandOfficialDebug'.
A problem occurred starting process 'command 'node''
Stop daemon helps when gradle daemon not started from terminal. E.g. Android Studio launches with custom env variables.
@gtzh110 Did you ever resolve your issue? Running into the same issue myself and none of the other suggestions are working.
UPDATE: I reverted back to buildToolsVersion 25.0.0 and this error went away. It appears that in upgrading to Android Studio 3.0.0 and taking the suggestion to update buildTools to 26.0.2 seems to have caused the error.
I got the same error with buildTools to 26.0.2 and Android Studio 3.0.0 on Mac
I got the same error with buildTools to 26.0.2 and Android Studio 3.0.0 on Mac
I got the same error with buildTools to 26.0.2 and Android Studio 3.0.0 on Mac @mkonicek could we reopen the issue?
I am seeing this as well with buildTools 26.0.2, Android Studio 3.0.0, and a Mac. Neither workaround above (./gradlew --stop or setting nodeExecutableAndArgs) helped for me. I have node available both at /usr/local/bin/node and via nvm (i.e. ~/.nvm/versions/node/v6.9.1/bin/node). Here's the output from ./gradlew --stacktrace:
Error:10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:recordFilesBeforeBundleCommandDevDebug'.
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > A problem occurred starting process 'command 'node''
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:recordFilesBeforeBundleCommandDevDebug'.
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
10:08:13.068 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'node''
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:220)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:340)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ... 3 more
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'node'
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ... 4 more
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.io.IOException: Cannot run program "node" (in directory "/Users/jacob/triggr/triggr_native_android/app"): error=2, No such file or directory
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ... 6 more
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.io.IOException: error=2, No such file or directory
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] ... 7 more
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
10:08:13.069 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 4s
And here are the relevant output lines from ./gradlew --debug:
10:08:13.042 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Execute task action 2/2 for :app:recordFilesBeforeBundleCommandDevDebug' started
10:08:13.042 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'node''. Working directory: /Users/jacob/triggr/triggr_native_android/app Command: node ../node_modules/react-native-code-push/scripts/recordFilesBeforeBundleCommand.js /Users/jacob/triggr/triggr_native_android/app/build/intermediates/res/merged/dev/debug
10:08:13.042 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'node'': {PATH=/usr/bin:/bin:/usr/sbin:/sbin, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.njnCUxFlBS/Listeners, SHELL=/bin/bash, XPC_FLAGS=0x0, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.d80ZuEwunz/Render, LOGNAME=jacob, XPC_SERVICE_NAME=com.google.android.studio.22720, USER=jacob, HOME=/Users/jacob, TMPDIR=/var/folders/dr/7f0vd5pj4yj020yp10fbg8d80000gn/T/}
10:08:13.042 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
10:08:13.043 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'node'.
10:08:13.058 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
10:08:13.058 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node'' finished with exit value -1 (state: FAILED)
10:08:13.058 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Execute task action 2/2 for :app:recordFilesBeforeBundleCommandDevDebug'
What's relevant there is that $PATH does not include /usr/local/bin, which is surprising and probably wrong.