我在Android Studio运行应用程序时遇到了问题。当我按下Run按钮时,“选择部署目标”对话框弹出,但我从未看到任何模拟器或设备出现。事件日志不断打印以下内容:
5/6/18
12:40 PM Gradle sync started
12:40 PM Project setup started
12:41 PM Gradle sync finished in 49s 932ms
12:41 PM Executing tasks: [:app:generateDebugSources]
12:41 PM Gradle build finished in 15s 765ms
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 1
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 2
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 3
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 4
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 5
我能够使用命令行运行react-native项目,但是在直接使用Android Studio时会出现以下问题。我尝试在Android Studio中创建新项目,但结果仍然相同。我认为这个问题始于我从Android Studio 3.0更新到3.1。你有什么解决方法或获取更多信息的想法吗?谢谢。
系统信息: MacOS High Sierra 10.3.14 Macbook Pro (Late 2011)
软件信息: Android Studio 3.1.2 Java 9.0.4