首页 > 解决方案 > Flutter iOS 设备:连接服务协议出错:无法连接到 http://127.0.0.1:1024

问题描述

在 Android Studio 中使用Flutter连接到真实 iOS 设备时出现问题。

"Error connecting to the service protocol: failed to connect to http://127.0.0.1:1024"

搜索并重新启动设备,切换到主频道似乎没有帮助。

flutter doctor节目

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76,
    locale en-US) 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)

标签: androidflutter

解决方案


  1. open ios/Runner.xcworkspace/, 清理构建目录

在此处输入图像描述

  1. 我也重新启动了手机,但不确定是否有必要。

推荐阅读