React Native无法运行stacktrace [英] React Native cannot run stacktrace
问题描述
我正在尝试在Mac上使用React Native启动测试项目(osx 10.12)。如果我运行:
I am trying to get a test project up and running with React Native on a Mac (osx 10.12). If I run:
react-native run-android --stacktrace
我收到以下错误:
错误:未知选项'--stacktrace'
我已经安装:
- Node Watchman
- 流程
- Java JDK
- Android SDK
- React Native CLI
- Genymotion
- Node Watchman
- Flow
- Java JDK
- Android SDK
- React Native CLI
- Genymotion
当我运行命令时,模拟器正在运行。
When I run the command the emulator is running.
谁能告诉我为什么会这样?非常感谢提前。
Can anyone tell me why this is happening? Many thanks in advance.
推荐答案
- stacktrace
建议不是'由 react-native run-android
命令输出,它来自它运行的一个命令。以下是使用 - stacktrace
选项运行它的方法。进一步阅读以获得解释。
The --stacktrace
suggestion isn't output by the react-native run-android
command, it comes from one of the commands it runs. Here's how to run it with the --stacktrace
option. Read further for an explanation.
cd android && ./gradlew installDebug --stacktrace
react-native run-android
实际上运行 cd android&& ./gradlew installDebug
正如您在 react-native run-android
react-native run-android
actually runs cd android && ./gradlew installDebug
as you can see in the following lines outputted by react-native run-android
Running /Users/upside/Library/Android/sdk/platform-tools/adb -s 0111474880b8a726 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installDebug)...
所以,如果你想用 - stacktrace
选项运行,你需要运行 cd android&& ./gradlew installDebug --stacktrace
So, if you want to run with the --stacktrace
option, you'll need to run cd android && ./gradlew installDebug --stacktrace
一旦你发现问题,你应该回到使用 react-native run-android
因为脚本可能会运行更多的命令。
Once you've figured out your problem, you should go back to using react-native run-android
as the script probably runs a lot more commands as well.
这篇关于React Native无法运行stacktrace的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!