My project build fails because it's using the incorrect directory to run Node. How do I go about setting the Node directory for these compile-time tasks?
The specific task is:
app:recordFilesBeforeBundleCommandDebug
And the related error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'node''
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'node'
Caused by: java.io.IOException: Cannot run program "node" (in directory "/Users/me/Code/appname/android/app"): error=2, No such file or directory
Caused by: java.io.IOException: error=2, No such file or directory
So to fix “SDK tools directory missing” in android studio, try the following methods The Cause for this error -SDK tools package might not be installed. Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools (obsolete).
Some antivirus software can interfere with the Android Studio build process, causing builds to run dramatically slower. When you run a build in Android Studio, Gradle compiles your app’s resources and source code and then packages the compiled resources together in an APK. During this process, many files are created on your computer.
Note: An easy way to locate your configuration directory is to navigate to Help > Edit Custom VM Options in Android Studio. This will open a configuration file. Inspect the path of the configuration file to find your configuration directory. You can also use the following environment variables to point to specific override files elsewhere:
The following list shows the default location of each Android Studio directory that you should exclude from real-time scanning: Gradle cache %USERPROFILE%.gradle Android Studio projects %USERPROFILE%AndroidStudioProjects Android SDK %USERPROFILE%AppDataLocalAndroidSDK. Android Studio system files. Syntax: %LOCALAPPDATA%Google<product><version>
It is a known bug for the environment:
Upgrade to Gradle version 6.9 or above in the gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
https://docs.gradle.org/6.9/release-notes.html
I am running Android Studio on MacOS and following worked for me: Yoruba's answer above and starting the application from Terminal with open -a "Android Studio.app"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With