Could not install the app on the device, read the error above fo Make sure you have an Android emulator running or a device conne set up your Android development environment



  • Could not install the app on the device, read the error above fo
    Make sure you have an Android emulator running or a device conne
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/android-setup.html
    cmd命令行启动native时报上面错误求支招


  • administrators

    read the error above for details



  • 使用webstorm启动rn有很多坑,建议如果一时解决不了可以使用Android Studio跑,效果是一样的。



  • @晴明 晴明老师,同样的问题,但是没有具体的错误信息

    ➜  rn-jser git:(master) ✗ react-native run-android
    (node:2553) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
    Starting JS server...
    Running /home/jim/Android/Sdk/platform-tools/adb -s 28d82b60 reverse tcp:8081 tcp:8081
    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
    

  • administrators

    @Dev-Fang 没有具体错误信息的原因一般是,你这个项目是从别处复制或者clone来的,导致gradlew脚本没有执行权限

    chmod +x ./android/gradlew
    

    加上运行权限即可


登录后回复