在根项目“android”React Native 中找不到“installDebug”

新手上路,请多包涵

我正在尝试在 android 模拟器上运行我的项目。当我运行 react-native run-android 我得到以下信息:

 FAILURE: Build failed with an exception.

* What went wrong: Task 'installDebug' not found in root project 'android'.

* Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

如果我运行 ./gradlew tasks 我得到:

 Build Setup tasks
-----------------
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'android'.
components - Displays the components produced by root project 'android'. [incubating]
dependencies - Displays all dependencies declared in root project 'android'.
dependencyInsight - Displays the insight into a specific dependency in root project 'android'.
help - Displays a help message.
model - Displays the configuration model of root project 'android'. [incubating]
projects - Displays the sub-projects of root project 'android'.
properties - Displays the properties of root project 'android'.
tasks - Displays the tasks runnable from root project 'android'.

知道为什么我的项目中没有 installDebug 任务吗?我该如何取回它?

原文由 Stephen Horvath 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 753
1 个回答

react-native run-android –variant [productFlavorName][debug/release]

例如 react-native run-android –variant Huaweidebug

原文由 Kenny Tian 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题