(node:53177) 未处理的Promise拒绝警告:未处理的promise拒绝(拒绝id:2):TypeError:无法读取未定义的“message”属性。

7

不确定是什么原因导致了这个问题.. 昨天它还好好的工作。今天当我尝试运行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

从我注意到的情况来看,当我更新了nodeJs之后,这个错误开始出现。现在我有v7.3.0。 - pauldcomanici
我正在使用 Node 6.9.2 .. 嗯 - Robert Cutright
1个回答

3

我曾经遇到过类似的问题,尝试在Ubuntu上运行一个在Windows上创建的项目。我找到的解决方法是在project/root/android中,gradlew文件没有被设置为可执行文件。所以只需要添加chmod +x gradlew即可解决这个问题。


这对我来说就是这样了。我的项目最初是在 Windows 机器上启动的,当克隆到 Mac 上时出现了这个错误。只是其中一个神奇的一行代码解决了我认为需要花费数小时才能解决的问题。谢谢! - 1mike12
2
2018年我该怎么做? - KernelDeimos

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接