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/>
相关推荐
wenxiaocsdn36 分钟前
macos虚拟机-演示篇三配置clover引导
macos
hweiyu0040 分钟前
Flutter零基础极速入门到进阶实战(视频教程)
flutter
hweiyu001 小时前
Flutter高级进阶教程(视频教程)
flutter
江湖人称小鱼哥1 小时前
WSL + Docker 网络访问详解
网络·docker·容器·wsl
☆璇3 小时前
【Linux】Socket编程UDP
linux·网络·udp
迷路爸爸1803 小时前
源码编译安装最新 tmux 教程(含 Debian/Ubuntu/CentOS/Arch/macOS 等系统)
linux·ubuntu·macos·centos·debian·tmux·archlinux
xingxing_F3 小时前
Rhino 8 for Mac 犀牛3D建模软件
macos·3d
真正的醒悟4 小时前
什么是网络割接
运维·服务器·网络
Bruce_Liuxiaowei4 小时前
Win7虚拟机加入域错误排查指南:解决无法启动服务问题
运维·网络·windows·安全·网络安全
歪歪1004 小时前
使用 Wireshark 进行 HTTP、MQTT、WebSocket 抓包的详细教程
网络·websocket·测试工具·http·wireshark