我的项目构建失败,因为它使用了错误的目录来运行Node。我该如何为这些编译时任务设置Node目录?
具体任务是:
app:recordFilesBeforeBundleCommandDebug
以及相关的错误:
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
答案 0 :(得分:3)
如果使用React-Native,则将其添加到build.gradle中
<?php
$sum = [];
foreach ($array as $key => $value) {
$letter = substr($key,0,1);
if (!isset($sum[$letter])){$sum[$letter] = 0;}
$sum[$letter] += $value;
}
var_dump($sum);
答案 1 :(得分:0)
我遇到了同样的问题,并通过重新安装node.js来解决,因为react无法找到它。
答案 2 :(得分:0)
我正在MacOS上运行Android Studio,以下对我有用:Yoruba的回答,并使用open -a "Android Studio.app"
从Terminal启动应用程序