我对Gradle很新,我一直在努力学习使用gradlew命令。在Mac终端,我运行:
kenneths-air:~ kennethwang$ /Users/kennethwang/Desktop/WHP2-New/gradlew ios:launchIOSDevice
WHP2-New是我的根项目目录,我的所有项目都在里面:whp2-new-core,whp2-new-ios,whp2-new-android,whp2-new-desktop。
但是,我在输出中得到了这个:
FAILURE: Build failed with an exception.
* What went wrong:
Project 'ios' not found in root project 'kennethwang'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
这是我的输出--info参数
kenneths-air:~ kennethwang$ /Users/kennethwang/Desktop/WHP2-New/gradlew ios:launchIOSDevice --info
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using empty build file.
Included projects: [root project 'kennethwang']
Evaluating root project 'kennethwang' using empty build file.
All projects evaluated.
FAILURE: Build failed with an exception.
* What went wrong:
Project 'ios' not found in root project 'kennethwang'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
好像它认为我的根目录位于错误的文件夹中,老实说,即使在谷歌搜索几个小时后,如何将其设置到正确的目录,我也不知道。
这是我的settings.gradle。最初rootProject.name不存在,但我添加了它仍然无法正常工作。
rootProject.name = ‘WHP2-new’
include 'desktop', 'android', 'ios', 'core'
gradlew和settings.gradle以及其他所有内容都在WHP2-New文件夹中。我在这里真的很丢失,有人能说清楚会发生什么吗?
由于
答案 0 :(得分:2)
您需要进入/Users/kennethwang/Desktop/WHP2-New/
,然后从那里运行构建。