[英]Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean length]
After upgrading some Flutter packages and the Flutter framework of the application i'm working on i got this error on iOS.升级一些 Flutter 包和我正在处理的应用程序的 Flutter 框架后,我在 iOS 上遇到了这个错误。 On VSCode it just build the application, but didn't got any useful info.
在 VSCode 上,它只是构建应用程序,但没有得到任何有用的信息。 On Xcode the application started with a white screen then printed this on console.
在 Xcode 上,应用程序以白色屏幕启动,然后在控制台上打印出来。
As i'm not used to iOS - Swift - Xcode ecosystem took me a while to figure this out, the Xcode logs were a bit confusing to me.由于我不习惯 iOS - Swift - Xcode 生态系统花了我一段时间才弄明白这一点,Xcode 日志让我有点困惑。 After reading issues on GitHub this popped out and had something related with my console message What should be the domainNetworkPolicy while using flutter in existing iOS App
在 GitHub 上阅读问题后,这突然出现并且与我的控制台消息相关的内容在现有 iOS 应用程序中使用 flutter 时域网络策略应该是什么
This made me realize that was something with the Info.plist file.这让我意识到这与 Info.plist 文件有关。
The problem was the package flutter_webview_plugin
and with its configuration on iOS.问题在于软件包
flutter_webview_plugin
及其在 iOS 上的配置。 The XML code was wrong after updating.更新后 XML 代码错误。
This is the correct XML, thanks to vanelizarov :这是正确的 XML,感谢vanelizarov :
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>url.com.br</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.