27

I am using react-native and updated android studio to 3.0. After updating while trying to debug on a device I am getting a build error.

Error:Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
> A problem occurred starting process 'command 'node''

I have stopped and rerun the gradle but I'm getting the same error.

1

6 Answers 6

88

for me i had to open Android Studio from terminal using this command for Mac users open -a "Android Studio"

Sign up to request clarification or add additional context in comments.

5 Comments

for me fixed also, but I don't understand why, this happened after an update I did on my mac, note, the android studio app is on an external hard drive, could that be why?
This also fixed my issues. I'd also like to understand why. The only difference I noticed was Android studio downloading a new gradle when opened via cmd line
It Worked. My theory is that this command is telling Android Studio what node version is set in the terminal. But if someone is clear about what is internally happening, please share it.
Worked for me as well. I suspect this is because an environment variable isn't set correctly in the app, but is in the shell. Anyway, similarly, if Android Studio is installed for all users, this command should also work: /Applications/Android\ Studio.app/Contents/MacOS/studio
Is there any proper solution, open android studio using command is not proper solution.
51

./gradlew --stop and then start the build your project again.

3 Comments

Thanks! Any explanation why this worked?
Mysteriously works! After wasting multiple hours banging my head across different solutions, this seemingly minusucle command worked like a charm!!
Wonderful! It’s the bundle command in my case ./gradlew bundleRelease.
14

You just need to fix the Gradle JDK version in settings. Go to Android Studio Settings->Build Execution, Deployment -> Build Tools -> Gradle and update the Gradle JDK version.

I wiped out my ~/.gradle folder that's why it had reset the Gradle JDK version and I have to set it again to correct version going to the Settings.

This solved for me https://github.com/expo/expo/issues/28309

1 Comment

5

Just got this error myself. Actually, just close Android Studio when doing ./gradlew assembleDebug in your cmd. It just blocks gradle node execution somehow.

1 Comment

Wow, who could have guessed this :O
4

This happens each time for me when installing Android Studio on a new mac, I have to change the Gradle JDK location to JAVA_Home instead of what the default value of Android Studio is. Change it by going to Android Studio Settings -> Build Execution, Deployment -> Build Tools -> Gradle JDK

For example, my JAVA_HOME is java 17 but Android Studio defaults to Jetbrains Runtime 21, which causes the

A problem occurred starting process 'command 'node'

error for me.

Check that Android Studio uses the actual Java version you want it to use. Using SDKMan in terminal doesn't mean that Android Studio also defaults to that Java Version.

enter image description here

Comments

0

This error may happen when there is a mismatch between the versions of the Java running in your environment and the required Java version of your project.

I ofter run with this problem between projects since I maintain multiple project (most of them are legacy) and usually fix the issue by selecting the correct Java version.

If you're running on MacOS, you can solve this issue by changing the java your terminal is using: You can just run

export JAVA_HOME="/Users/YOUR_USERNAME/Library/Java/JavaVirtualMachines/{JAVA_INSTALATION_FOLDER}/Contents/Home"

just replace JAVA_INSTALATION_FOLDER for your desired Java version and YOUR_USERNAME to your username folder. This works for Sequoia 15 or later

You can also do this on Android Studio by opening Settings > Build, Execution, Deployment > Build Tools > Gradle and changing the Gradle JDK version (you can install multiple java versions using Android Studio)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.