【问题标题】:White blank screen with Cordova iOS cordova-plugin-wkwebview-engine plugin带有 Cordova iOS cordova-plugin-wkwebview-engine 插件的白色空白屏幕
【发布时间】:2020-08-24 10:31:44
【问题描述】:

我们有一个使用 cordova 的 React 应用程序,但我们收到以下错误:

***ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability.***

我添加了 cordova-plugin-wkwebview-engine 插件并遵循了 cordova 文档。

另外,我在config.xml 中添加了这些:

<feature name="CDVWKWebViewEngine">
     <param name="ios-package" value="CDVWKWebViewEngine" /> 
</feature> 
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

cordova-plugin-ionic-webview 插件未安装在项目中。添加此插件后,应用卡在白色空白屏幕上。

我尝试在config.xml file 中添加&lt;preference name="WKWebViewOnly" value="true" /&gt;,但问题仍然存在。

如果我删除插件,应用程序就可以正常工作,但 TestFlight 会拒绝它。

任何帮助将不胜感激!

【问题讨论】:

    标签: cordova uiwebview cordova-plugins wkwebview testflight


    【解决方案1】:

    在将我的头撞到墙上将近 3 天后,我解决了我的问题。在这里发布我的步骤/解决方案以防有人需要。

    我将 cordova-ios 更新为最新的稳定版本 (5.1.1),我只使用 cordova-plugin-ionic-webview em>,不是 cordova-plugin-wkwebview-engine

    es6-promise-plugin 添加到项目中修复了白屏问题(对我来说没有意义,但它有效)。

    这里是所有 cordova 插件的列表:

    • cordova-plugin-device 2.0.3“设备”
    • cordova-plugin-file 6.0.2“文件”
    • cordova-plugin-file-opener2 3.0.0 "文件打开器2"
    • cordova-plugin-ionic-webview 4.2.1 “cordova-plugin-ionic-webview”
    • cordova-plugin-screen-orientation 3.0.2“屏幕方向”
    • cordova-plugin-splashscreen 5.0.3“闪屏”
    • cordova-plugin-statusbar 2.4.3“状态栏”
    • cordova-plugin-whitelist 1.3.4“白名单”
    • es6-promise-plugin 4.2.2“承诺”

    这是我的 config.xml

    <platform name="ios">
       <preference name="WKWebViewOnly" value="true" />
       <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
       <feature name="CDVWKWebViewEngine">
           <param name="ios-package" value="CDVWKWebViewEngine" />
       </feature>
       <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
       ...
       ...
       ...
    </platform>
    

    【讨论】:

    • 感谢您分享您的解决方案,因为我无缘无故地遇到了这个问题,它刚刚在 2 小时前工作......即使我没有使用 Ionic,我是否需要使用 cordova-plugin-ionic-webview只有科尔多瓦?谢谢。
    • 抱歉回复晚了。是的,就我而言,如果我不包含cordova-plugin-ionic-webview(这对我来说没有意义,因为我也不使用Ionic,但是......如果它有效,它会引发错误: ) ).
    【解决方案2】:

    非常感谢您发布您的解决方案。我有一个类似的问题,正在努力寻找答案。在我的情况下,启动画面仍然存在,并且应用程序在升级到 WKWebView 后无法运行。

    我只将您的插件列表的一个子集(仅需要的插件)更新为您推荐的版本以及 config.xml 中的一些差异,但它现在可以工作了。你是救命稻草。

    插件更新

    • cordova-plugin-device 2.0.3“设备”
    • cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
    • cordova-plugin-splashscreen 5.0.3“启动画面”
    • cordova-plugin-statusbar 2.4.3“状态栏”
    • cordova-plugin-whitelist 1.3.4“白名单”

    不需要

    • cordova-plugin-file 6.0.2“文件”
    • cordova-plugin-file-opener2 3.0.0 "文件打开器2"
    • cordova-plugin-screen-orientation 3.0.2“屏幕方向”
    • es6-promise-plugin 4.2.2“承诺”

    config.xml

    <feature name="CDVWKWebViewEngine"><br>
      <param name="ios-package" value="CDVWKWebViewEngine" /><br>
    </feature><br>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /><br>
    <br> 
    <allow-navigation href="http://localhost:8080/*" />`<br>
    

    【讨论】:

      猜你喜欢
      • 2020-07-10
      • 2022-12-14
      • 1970-01-01
      • 2019-09-22
      • 2017-02-02
      • 2021-01-16
      • 1970-01-01
      • 2015-10-17
      • 2023-03-30
      相关资源
      最近更新 更多