不确定是什么导致了这个问题..昨天工作正常。今天,当我尝试运行react-native run-android时。我收到这个错误。任何想法?
Starting JS server...
Running adb -s 3f71ece6 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
(node:53177) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
答案 0 :(得分:3)
我在尝试运行在Ubuntu上在Windows上创建的项目时遇到了类似的问题。我发现的解决方案是gradlew
中的project/root/android
文件未设置为可执行文件。因此,只需添加chmod +x gradlew
即可解决此问题。