简体   繁体   English

Cordova IOS 应用程序在 IOS 14 中显示白屏

[英]Cordova IOS app shows white screen in IOS 14

Cordova IOS app shows white screen in IOS 14. But app is working below IOS 14 version. Cordova IOS 应用程序在 IOS 14 中显示白屏。但应用程序在 IOS 14 版本以下运行。 I updated my Xcode to Version 12.0.我将我的 Xcode 更新到了 12.0 版。 Cordova IOS platform version is 6.1.0. Cordova IOS平台版本为6.1.0。 Cordova version is 10.0.0. Cordova 版本是 10.0.0。 Below are the plugin details and preferences in config.xml file.以下是 config.xml 文件中的插件详细信息和首选项。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-splashscreen" spec="^6.0.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreenDuration" value="0" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="2000" />
<preference name="FadeSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="orientation" value="portrait" />
<preference name="DisallowOverscroll" value="true" />

I tried removing all plugins except whitelist.我尝试删除除白名单之外的所有插件。 I removed preferences related to splashscreen and tried it.我删除了与闪屏相关的首选项并尝试了它。 Still app shows white screen.静止应用程序显示白屏。

Please help me.请帮我。 Any help should be appreciated.任何帮助都应该受到赞赏。 Thanks in advance.提前致谢。

I found the answer.我找到了答案。

I uninstalled splashscreen plugin.我卸载了闪屏插件。 By default splashscreen available in Cordova IOS platform 6.1.0.默认启动画面在 Cordova IOS 平台 6.1.0 中可用。

In project root folder, check for res folder.在项目根文件夹中,检查 res 文件夹。 If res folder is not available we have to create a res folder path like this "res/screen/ios/" and upload the splash screen images in ios folder.如果 res 文件夹不可用,我们必须创建一个像“res/screen/ios/”这样的 res 文件夹路径,并在 ios 文件夹中上传启动画面图像。

Then add this in your config.xml然后在你的 config.xml 添加这个

<splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
<splash src="res/screen/ios/screen-ipad-landscape.png" />
<splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
<splash src="res/screen/ios/screen-ipad-portrait.png" />
<splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
<splash src="res/screen/ios/screen-iphone-landscape.png" />
<splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
<splash src="res/screen/ios/screen-iphone-portrait.png" />

Below are the edited config.xml code which worked for me.以下是对我有用的编辑过的 config.xml 代码。

<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    
    <splash src="res/screen/ios/screen-ipad-landscape-2x.png" />
    <splash src="res/screen/ios/screen-ipad-landscape.png" />
    <splash src="res/screen/ios/screen-ipad-portrait-2x.png" />
    <splash src="res/screen/ios/screen-ipad-portrait.png" />
    <splash src="res/screen/ios/screen-iphone-landscape-2x.png" />
    <splash src="res/screen/ios/screen-iphone-landscape.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" />
    <splash src="res/screen/ios/screen-iphone-portrait.png" />
</platform>

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<plugin name="cordova-plugin-network-information" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />

Cheers.干杯。

我降级到cordova-ios@5.1.1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM