react-native icon indicating copy to clipboard operation
react-native copied to clipboard

:app:recordFilesBeforeBundleCommandDebug FAILED

Open john916zhang opened this issue 10 years ago • 40 comments

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

john916zhang avatar Apr 08 '16 07:04 john916zhang

Seems it cannot find node in your path. Is your path setup correctly?

satya164 avatar Apr 16 '16 21:04 satya164

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

john916zhang avatar Apr 16 '16 23:04 john916zhang

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.

Bhullnatik avatar Apr 21 '16 15:04 Bhullnatik

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 avatar Apr 29 '16 19:04 seeligd

@seeligd it works,thank you!

windylcx avatar May 16 '16 06:05 windylcx

@seeligd you're the man

mangogogos avatar Jun 24 '16 20:06 mangogogos

@seeligd Thank you. But Why?

king6cong avatar Jul 12 '16 12:07 king6cong

Is this related to NVM perhaps? I'm definitely using NVM, and I've seen this issue as well.

pthrasher avatar Jul 13 '16 19:07 pthrasher

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.

mkonicek avatar Oct 27 '16 22:10 mkonicek

Hi! Still experiencing this issue right now, even after running ./gradlew --stop as suggested multiple times. Any ideas?

chuckhacker avatar Jan 31 '17 22:01 chuckhacker

By changing node executable path in build.gradle(app) works for me.

project.ext.react = [
        nodeExecutableAndArgs : ["/usr/local/bin/node"]
];

cskaynar avatar Apr 11 '17 10:04 cskaynar

@cskaynar good!

birthmark avatar Jun 15 '17 09:06 birthmark

./gradlew --stop or simply you can close your Android Studio

masako-yamada avatar Jul 17 '17 13:07 masako-yamada

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''

gtzh110 avatar Oct 11 '17 02:10 gtzh110

Stop daemon helps when gradle daemon not started from terminal. E.g. Android Studio launches with custom env variables.

westito avatar Oct 11 '17 06:10 westito

@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.

hatlestad avatar Oct 27 '17 13:10 hatlestad

I got the same error with buildTools to 26.0.2 and Android Studio 3.0.0 on Mac

thanhthang20 avatar Oct 30 '17 00:10 thanhthang20

I got the same error with buildTools to 26.0.2 and Android Studio 3.0.0 on Mac

olivercm avatar Oct 30 '17 11:10 olivercm

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?

yurilaguta avatar Oct 31 '17 08:10 yurilaguta

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.

artdent avatar Nov 10 '17 16:11 artdent