简体   繁体   English

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFBoolean length]

[英]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.

相关问题 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[NSDecimalNumber长度]: - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber length]: 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“数据参数为nil” - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil' 由于未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用程序,原因:&#39;-[__ NSCFArray length]:无法识别的选择器已发送到实例 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray length]: unrecognized selector sent to instance 由于未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用程序,原因:&#39;-[NSNull长度]:无法识别的选择器已发送到实例 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[SWRevealViewController manifestToggel:] - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SWRevealViewController revealToggel:] 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[FBSDKProfilePictureView CGImage]: - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBSDKProfilePictureView CGImage]: 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[MKUserLocation标记]: - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation tag]: 由于未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用程序,原因:&#39; - [UIButton setText:] - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButton setText:] 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFString isDescendantOfView:]: - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString isDescendantOfView:]: 由于未捕获的异常&#39;NSInvalidArgumentException&#39;而终止应用程序,原因:未知的布局属性&#39; - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: Unknown layout attribute'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM