On Mac - Trying to run app in Android Studio ends with
FAILURE: Build failed with an exception.
* Where:
Build file '/Volumes/NHRISTOVA/Work/NS-UI/App14/platforms/android/build-tools/android-static-binding-generator/build.gradle' line: 231
* What went wrong:
Execution failed for task ':asbg:runAstParser'.
> java.io.IOException: Cannot run program "node": error=2, No such file or directory
/platforms/android/build.gradle in Android Studio and try to run it from there_NOTE: Works on Windows_
After investigating, I found out android studio in mac can't find the executables in the PATH, where the node executable is, when ArrayList.execute() is used. We should find a new way to run this command with gradle, and the problem should be fixed.
Update: turns out Android Studio doesn't inherit the PATH env variables. As a workaround Android Studio can be started through the terminal as described in this comment
Update: Triied using several node plugins for gradle, but they have the same issue. This issue can be solved with an init.gradle script in the $GRADLE_HOME directory, but it would be simpler to start Android Studio on mac through the terminal, and seems like a legitimate solution to the problem until gradle allows better usage of executables in the $PATH.
Closing this issue, because the effort of making gradle work automatically is not worth considering the workaround provided. Will reopen if gradle figures out a way to start executables on mac.
Most helpful comment
Update: turns out Android Studio doesn't inherit the PATH env variables. As a workaround Android Studio can be started through the terminal as described in this comment