解决flutter desktop 网络请求失败

flutter笔记汇总

使用了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 Developer Program License Agreement 1.2 原文内容如下: 1.2...
    _moses阅读 3,459评论 0 1
  • 投射我儿早睡早起,注意面部卫生,脸上的毛囊炎好了,面部也光滑如初。 投射我儿在校认真听课,努力学习,有计划,有目标...
    花开生两面阅读 1,137评论 0 0
  • 【0505我在悦读】珂珂 第16次打卡 书名:《断舍离》 章节: 第一章 只要了解个中奥妙,就能激发干劲——断舍离...
    我是珂珂呀阅读 1,839评论 0 0