我正在尝试在我的手机中构建和运行 React Native 应用程序。我尝试使用入门,它工作正常。我执行以下操作
cd AwesomeProject
react-native start
- 在终端中打开一个新选项卡
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
react-native run-android
它在我的安卓手机上运行。
git clone https://github.com/h87kg/NavigatorDemo.git
cd NavigatorDemo
react-native start
我得到Command 'start' unrecognized. Did you mean to run this inside a react-native project?
错误。我应该怎么做才能运行这个项目?任何帮助表示赞赏。提前致谢。
更新
安装依赖项后,npm install
我可以运行服务器。现在,当我尝试运行时react-native run-android
,出现以下错误
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Could not install the app on the device, see the error above.