问题描述
我已经开发了适用于Android和iOS的离子应用程序.当我尝试将应用程序提交到iOS时,我总是会收到相同的错误.
我在整个项目中进行了搜索,找不到对UIWebView的任何引用.
我已按照此
但是我仍然遇到相同的错误
我最近已针对确切的问题修复了我的应用,以下是我为解决此问题所遵循的步骤:
- 确保您的
cordova-plugin-ionic-webview
已更新为最新版本5.0.0
.您需要运行这两个命令来做到这一点.
ionic cordova插件删除cordova-plugin-ionic-webviewionic cordova插件添加cordova-plugin-ionic-webview @ latest
- 确保您的
cordova-ios
已更新为最新版本6.0.0
.运行此命令以对其进行更新.
npm install cordova-ios @ latest --save
-
检查您的
package.json
,看看是否同时更新了cordova-ios
和cordova-plugin-ionic-webview 的版本代码>.
确保将
WKWebViewOnly
首选项添加到config.xml
文件.
<平台名称="ios"< preference name =" WKWebViewOnly"值=真"/>...</platform>
这是最重要的步骤.确保删除
ios
平台并再次添加.运行这些命令以删除和添加ios平台.
ionic cordova平台rm ios离子cordova平台添加ios
现在,当您构建ios应用并将其发布到应用商店时,您会看到问题已得到解决.
I have developed an ionic app that is for Android and iOS.When I try to submit the application to iOS I always receive the same error.
I searched in my entire project and I can't find any reference to UIWebView.
I have followed this link to update all my plugins.
I added this code to my config.xml:
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
I updated my cordova and my ionic versions:cordova version - 9.0.0 (cordova-lib@9.0.1)ionic version - 6.10.1
I've tried several tutorials like the ones on these links and others:
https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/https://mobilefirstplatform.ibmcloud.com/blog/2020/01/27/Removal-of-UIWebview/
But whenever I submit the application to Apple, it gets rejected because of this error.
What can I do to remove UIWebView or get my application approved?
Thanks
Update:
Ionic:
Ionic CLI : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)Ionic Framework : @ionic/angular 4.10.2@angular-devkit/build-angular : 0.13.9@angular-devkit/schematics : 7.2.4@angular/cli : 7.3.8@ionic/angular-toolkit : 1.4.1
Capacitor:
Capacitor CLI : 1.5.2@capacitor/core : 1.0.0-beta.19
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)Cordova Platforms : ios 5.1.1Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 16 other plugins)
Utility:
cordova-res : not installednative-run : 1.0.0
System:
ios-sim : 8.0.2NodeJS : v12.18.1 (/usr/local/bin/node)npm : 6.14.5OS : macOS CatalinaXcode : Xcode 11.5 Build version 11E608c
Updateing my question using @Harish answer
However I still get the same error
解决方案
I have fixed my app for the exact issue recently and Here are the steps I have followed to fix the issue:
Ensure your
cordova-plugin-ionic-webview
is updated to the latest version5.0.0
. You need to run these two commands to do that.
ionic cordova plugin remove cordova-plugin-ionic-webview
ionic cordova plugin add cordova-plugin-ionic-webview@latest
Ensure your
cordova-ios
is updated to the latest version6.0.0
. Run this command to update it.
npm install cordova-ios@latest --save
Check your
package.json
to see if the versions are updated for bothcordova-ios
andcordova-plugin-ionic-webview
.Ensure you add
WKWebViewOnly
preference toconfig.xml
file.
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
...
</platform>
This is the most important step. Ensure you remove the
ios
platform and add it again. Run these commands to remove and add the ios platform.
ionic cordova platform rm ios
ionic cordova platform add ios
Now, when you build the ios app and publish it to the app store, you can see the issue will be fixed.
这篇关于UIWebView将离子应用程序提交给Apple时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!