我正在制作一個 HTTP 是除錯或組態檔構建,它作業正常。但是如果我切換到 Release 它不再有效
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Failed host lookup: '*******.*******.*****.io' (OS Error: nodename nor servname provided, or not known, errno = 8)
#0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681)
#1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1808)
#2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)
#3 RawSecureSocket.startConnect (dart:io/secure_socket.dart:237)
#4 SecureSocket.startConnect (dart:io/secure_socket.dart:60)
#5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2437)
#6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2808)
#7 _HttpClient._getConnection (dart:_http/http_impl.dart:2813)
我認為這是 Internet 權限問題,但我找不到需要添加權限的位置(info.plist?)以及需要添加哪些權限?
[?] Connected device (3 available)
? iPad Pro (12.9-inch) (5th generation) (mobile) ? 00008103-000E44D10C3B001E ? ios ? iOS 15.1 19B74
? macOS (desktop) ? macos ? darwin-arm64 ? macOS 12.0.1 21A559 darwin-arm
? Chrome (web) ? chrome ? web-javascript ? Google Chrome 96.0.4664.110
uj5u.com熱心網友回復:
檢查此MacOS flutter 檔案。
在macos/Runner/DebugProfile.entitlements和 中添加以下幾行macos/Runner/Release.entitlements:
<key>com.apple.security.network.client</key>
<true/>
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/403685.html
標籤:
下一篇:即使現代并發向后兼容,為什么我仍會看到有關“data(for:delegate:)僅在iOS15.0 上可用”的錯誤訊息
