当我运行`tns build android`时出现错误`spawn ./gradlew ENOENT`

时间:2018-12-28 21:55:22

标签: nativescript

我从nativescript开始。我正在尝试构建一个hello world应用程序来对其进行测试。但是,当我运行它时,找不到命令的退出状态为127。

这是我尝试构建的方法:

[ahmed@localhost hello]$ tns build android
Executing before-shouldPrepare hook from /home/ahmed/PycharmProjects/hello/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Building project...
Gradle build...
spawn ./gradlew ENOENT
[ahmed@localhost hello]$ echo $?
127
[ahmed@localhost hello]$ 

如果我运行tns doctor,一切似乎都很好

[ahmed@localhost hello]$ tns doctor
✔ Getting environment information 

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.1 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.
✔ Component tns-ios has 5.1.0 version and is up to date.
[ahmed@localhost hello]$ 

我想念什么?

2 个答案:

答案 0 :(得分:1)

我运行了tns install以安装依赖项。那解决了我的问题。

答案 1 :(得分:0)

我尝试了几件事情,其中​​最适合我的是:

  1. ns clean
  2. ns install