React Native项目无法在Mac上运行

shi*_*zou 1 macos android reactjs react-native

我正在尝试在Mac上运行React Native,我在后台运行Android模拟器并运行,react-native run-android我得到:

=> react-native run-android
Scanning 564 folders for symlinks in /Users/sao/Conv/Conv2/node_modules (19ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Run Code Online (Sandbox Code Playgroud)

React Awesome 项目 ( react-native init) 在本机上运行良好,并且该项目在 Windows 上运行良好。

它说检查上面的错误以获取详细信息,但上面没有错误......

关于如何使其发挥作用有什么想法吗?

Rah*_*ran 5

尝试adb devices在终端中运行,如果它是空白运行adb kill-server,则继续执行adb start-server

  • 尝试在应用程序根文件夹中运行“chmod 755 android/gradlew”,然后运行“react-native run-android”,这可能是因为 gradle 权限来源:https://github.com/facebook/react-native/issues/ 8868#issuecomment-233458065 (3认同)