本文主要是介绍Flutter运行MacOs网络请求报错Unhandled Exception: DioException [connection error]:...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错信息
[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文件中添加如下代码
<key>com.apple.security.network.client</key>
<true/>
这篇关于Flutter运行MacOs网络请求报错Unhandled Exception: DioException [connection error]:...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!