gpt4 book ai didi

cordova - 为 ionic 5 代码构建 ios 时出现 defaultWebpagePreferences 错误

转载 作者:行者123 更新时间:2023-12-02 16:25:53 32 4
gpt4 key购买 nike

我正在尝试为 ionic 5 应用程序构建 ios 版本,但在构建该应用程序时我的应用程序中出现此错误。我在互联网上寻找解决方案,但似乎没有任何效果

/Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:141:27: error: property
'defaultWebpagePreferences' not found on object of type 'WKWebViewConfiguration *'
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
^
/Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:141:76: error: use of undeclared
identifier 'WKContentModeMobile'
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
^
/Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:143:27: error: property
'defaultWebpagePreferences' not found on object of type 'WKWebViewConfiguration *'
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
^
/Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:143:76: error: use of undeclared
identifier 'WKContentModeDesktop'
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;

最佳答案

您的 Xcode 版本可能是您的 Cordova iOS 平台不支持的版本。如果您降级您的 cordova-ios 平台版本,它应该可以工作。尽管如此,我强烈建议尽可能更新您的 Xcode。

此更改是在版本 6.1.0 中引入的。在此处检查提交:https://github.com/apache/cordova-ios/commit/440fc0fe01dabbccfd703ac7854fd24b0b88e1b5

这意味着使用 ios 平台的版本 6.0.0 可能有效。安装:

cordova platform rm ios
cordova platform install ios@6.0.0

但是这个版本还有其他问题在后来的 cordova-ios 补丁版本中解决。

关于cordova - 为 ionic 5 代码构建 ios 时出现 defaultWebpagePreferences 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64554071/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com