请求百度如下错误
SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = www.baidu.com, port = 443
处理方式
- 使用了dio,模拟器和web都没问题,只有desktop不能调接口
- 需要在macos/Runner/DebugProfile.entitlements文件中添加com.apple.security.network.client。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
标签:apple,network,client,失败,security,com,flutter,请求
From: https://www.cnblogs.com/guanchaoguo/p/17798357.html