Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 平台在Flatter IOS中不允许使用不安全的HTTP_Flutter - Fatal编程技术网

Flutter 平台在Flatter IOS中不允许使用不安全的HTTP

Flutter 平台在Flatter IOS中不允许使用不安全的HTTP,flutter,Flutter,我已经在编写的iOS/Runner/info.plist文件中显示了我的代码 <key>NSAppTransportSecurity</key> <key>NSAllowsArbitraryLoads</key> <true/> NSAppTransportSecurity NSAllowsArbitraryLoads 在我的代码中,但问题并没有得到解决 <?xml version="1.0" encodi

我已经在编写的iOS/Runner/info.plist文件中显示了我的代码

<key>NSAppTransportSecurity</key>
<key>NSAllowsArbitraryLoads</key>
<true/>
NSAppTransportSecurity
NSAllowsArbitraryLoads
在我的代码中,但问题并没有得到解决

<?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>NSAppTransportSecurity</key>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Leads</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

NSAppTransportSecurity
NSAllowsArbitraryLoads
CfBundledDevelopmentRegion
$(开发语言)
Cbundlexecutable
$(可执行文件名称)
CbundleIdentifier
$(产品\捆绑包\标识符)
CbundleInfo字典版本
6
CFBundleName
引导
CbundlePackageType
应用
CbundleShortVersionString
$(颤振\u构建\u名称)
CFBundleSignature
????
循环流化床锅炉
$(颤振/建造/编号)
LSREQUIRESPHONEOS
UILaunchStoryboardName
发射屏
UIMainstryBoardFile
主要
UI支持接口方向
UIInterfaceOrientationPortrait
UIInterface方向和左视图
UIInterfaceOrientationAndscapeRight
UI支持界面方向~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientation上下方向图
UIInterface方向和左视图
UIInterfaceOrientationAndscapeRight
UIViewControllerBasedStatusBarAppearance

您在
info.plist
文件中添加了错误的字符串

只要替换这个:

<key>NSAppTransportSecurity</key>
<key>NSAllowsArbitraryLoads</key>
<true/>
NSAppTransportSecurity
NSAllowsArbitraryLoads
据此:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads

嗨!您究竟如何尝试建立http连接?你能提供你的飞镖代码和你得到的错误吗?@Mol0ko我更新了我的代码,请检查it@Mol0ko谢谢你帮我这个问题解决得很好!如果我的回答对你有帮助,请接受或投票赞成