Flutter运行MacOs网络请求报错Unhandled Exception: DioException [connection error]:...

报错信息
bash 复制代码
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [connection error]: The connection errored: Connection failed This indicates an error which most likely cannot be solved by the library.
Error: SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = rap2api.taobao.org, port = 80
解决方法

在macos/macos/Runner/DebugProfile.entitlements文件中添加如下代码

bash 复制代码
<key>com.apple.security.network.client</key>     
<true/>
相关推荐
Johnstons3 小时前
Wireshark ExpertInfo是什么?一文讲透异常分级、适用场景、和传统抓包阅读的区别与排查标准
网络·测试工具·wireshark·es
alxraves3 小时前
医疗器械软件注册指导原则注意事项
网络·安全·健康医疗·制造
brucelee1864 小时前
Claude Code 安装教程(Windows / Linux / macOS)
linux·windows·macos
GCKJ_08246 小时前
观成科技:利用DoH加密通信的恶意木马流量分析
网络
zjun10016 小时前
TCP专栏-1.TCP协议概念说明
网络·网络协议·tcp/ip
maaath7 小时前
【maaath】Flutter for OpenHarmony 实战:旅游攻略应用开发指南
flutter·华为·harmonyos
德迅云安全杨德俊7 小时前
DDoS 解析与防御体系
网络·安全·web安全·ddos
jiejiejiejie_7 小时前
Flutter for OpenHarmony 跨平台开发:计算器功能实战指南
flutter
国科安芯7 小时前
商业航天电机控制领域抗辐射 MCU 芯片应用研究
网络·单片机·嵌入式硬件·安全性测试
Lentou7 小时前
日志轮询策略
linux·服务器·网络