如何在Linux上的ReactNative中使用gradle解决此错误?

时间:2016-03-15 05:16:06

标签: android linux reactjs react-native

注意:我实际上刚刚解决了这个问题,我在这里发布了我的解决方案,因为这是一个模糊的错误消息需要一些时间来解决。希望我可以帮助另一个人!

> react-native run-android 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

在网上看,我看到了类似的错误信息,但是更加冗长,并以其他方式解决了。我的解决方案很幸运,而且它在下面的答案中!

2 个答案:

答案 0 :(得分:1)

只需将./android/gradlew设为可执行文件即可。 (chmod +x android/gradlew

您可以测试它是否正在使用cd android && ./gradlew

只需尝试./gradlew并获得需要执行的更有说服力的错误消息即可解决这个问题。

如果你偶然发现了这个错误,祝你项目的其余部分好运!

答案 1 :(得分:0)

您是否连接了实际设备或仿真器?如果您没有参考GenyMotion(https://www.genymotion.com/download/)的设置,一旦完成创建模拟器。这应该可以解决您的问题。如果您仍然面临问题,请告诉我

相关问题