安装后第一次加载时,启动后Cordova/Phonegap卡在黑屏上的应用程序构建

安装后第一次加载时,启动后Cordova/Phonegap卡在黑屏上的应用程序构建,cordova,phonegap-plugins,cordova-plugins,splash-screen,Cordova,Phonegap Plugins,Cordova Plugins,Splash Screen,我正在用Cordova/Phonegap构建一个应用程序,并在其中使用了一个chcp插件。当我在安装后第一次打开它时,该应用程序在启动屏幕后被粘在了一个黑屏上 当我关闭应用程序并再次启动它时,它工作正常,但启动时仅延迟9-10秒,我将启动屏幕的时间延长到10秒,以避免出现黑屏 以下是config.xml: <?xml version="1.0" encoding="UTF-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xml

我正在用Cordova/Phonegap构建一个应用程序,并在其中使用了一个chcp插件。当我在安装后第一次打开它时,该应用程序在启动屏幕后被粘在了一个黑屏上

当我关闭应用程序并再次启动它时,它工作正常,但启动时仅延迟9-10秒,我将启动屏幕的时间延长到10秒,以避免出现黑屏

以下是
config.xml

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.storehippo.profitdeals" versionCode="103" version="1.0.3">
    <name>Test</name>
    <description>CHCP splash Test</description>
    <author email="akshay.tiwari@mausis.com" href="http://cordova.io">Akshay Tiwari</author>
    <content src="index.html"/>
    <access origin="*"/>
    <gap:config-file platform="ios" parent="CFBundleShortVersionString">
        <string>103</string>

    </gap:config-file>
<chcp>
            <config-file url="http://s3.amazonaws.com/mystore.in/s/55d178025c64d45531612809/ms.mobile_app_themes/560bd8ec31fec3dd1dd66fb7/chcp.json"/>
    </chcp>
    <gap:platform name="android"/>
    <gap:platform name="ios"/>
    <preference name="permissions" value="none"/>
    <preference name="orientation" value="default"/>
    <preference name="android-windowSoftInputMode" value="adjustResize"/>
    <preference name="fullscreen" value="false"/>
    <preference name="webviewbounce" value="true"/>
    <preference name="android-minSdkVersion" value="14"/>
    <preference name="KeepRunning" value="false"/>
    <preference name="LoadUrlTimeoutValue" value="10000"/>
    <preference name="android-installLocation" value="auto"/>
    <preference name="AutoHideSplashScreen" value="false"/>
    <preference name="SplashScreenDelay" value="10000"/>
    <preference name="DisallowOverscroll" value="true"/>
    <preference name="StatusBarOverlaysWebView" value="false"/>
    <preference name="StatusBarBackgroundColor" value="#000000"/>
    <preference name="StatusBarStyle" value="lightcontent"/>
    <preference name="phonegap-version" value="3.7.0" />
    <icon src="nocon.png"/>
    <icon src="icons/ios/reader-57-1.png" gap:platform="ios" width="57" height="57"/>
    <icon src="icons/ios/reader-72-1.png" gap:platform="ios" width="72" height="72"/>
    <icon src="icons/ios/reader-76-1.png" gap:platform="ios" width="76" height="76"/>
    <icon src="icons/ios/reader-114-1.png" gap:platform="ios" width="114" height="114"/>
    <icon src="icons/ios/reader-120-1.png" gap:platform="ios" width="120" height="120"/>
    <icon src="icons/ios/reader-144-1.png" gap:platform="ios" width="144" height="144"/>
    <icon src="icons/ios/reader-152-1.png" gap:platform="ios" width="152" height="152"/>
    <icon src="icons/android/ldpi.png" gap:platform="android" gap:density="ldpi"/>
    <icon src="icons/android/mdpi.png" gap:platform="android" gap:density="mdpi"/>
    <icon src="icons/android/hdpi.png" gap:platform="android" gap:density="hdpi"/>
    <icon src="icons/android/xhdpi.png" gap:platform="android" gap:density="xhdpi"/>
    <gap:splash src="splash.png"/>
    <gap:splash src="splash/ios/Default.png" gap:platform="ios" width="1024" height="768"/>
    <gap:splash src="splash/ios/Default-Portrait.png" gap:platform="ios" width="768" height="1024"/>
    <gap:splash src="splash/ios/Default@2x.png" gap:platform="ios" width="2048" height="1536"/>
    <gap:splash src="splash/ios/Default-Portrait@2x.png" gap:platform="ios" width="640" height="960"/>
    <gap:splash src="splash/ios/Default-568h@2x.png" gap:platform="ios" width="640" height="1136"/>
    <gap:splash src="splash/android/ldpi.png" gap:platform="android" gap:density="ldpi"/>
    <gap:splash src="splash/android/mdpi.png" gap:platform="android" gap:density="mdpi"/>
    <gap:plugin name="cordova-hot-code-push-plugin" source="npm" version="1.0.4"/>
    <gap:plugin name="cordova-plugin-device" source="npm" version="1.1.0" />
    <gap:plugin name="cordova-plugin-dialogs" source="npm" version="1.2.0" />
    <gap:plugin name="cordova-plugin-inappbrowser" source="npm" version="1.1.0" />
    <gap:plugin name="cordova-plugin-network-information" source="npm" version="1.1.0" />
    <gap:plugin name="cordova-plugin-push-notification" source="npm" version="2.5.2" />
    <gap:plugin name="cordova-plugin-splashscreen" source="npm" version="3.0.0" />
    <gap:plugin name="cordova-plugin-statusbar" source="npm" version="2.0.0" />
    <gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.0.0" />
    <gap:plugin name="cordova-plugin-x-toast" source="npm" version="2.2.2" />
    <gap:plugin name="cordova.plugins.diagnostic" source="npm" version="2.2.4" />
</widget>

测验
CHCP飞溅试验
阿克什提瓦里
103

当你说在黑屏上卡住时,你的意思是它真的卡住了,你必须强制关闭应用程序,还是它只是显示一个黑屏,然后应用程序立即加载

我对安装后的第一次加载有一个问题,在启动屏幕之后,第一次安装应用程序时通常(可能总是)会显示一个黑屏一两秒钟,然后会按预期加载,但它不会被正确的参数卡住(只会显示所述的黑屏几秒钟)。随后重新打开的应用程序不会出现这样的问题(只发生在初始安装时)…我仍在寻找修复该问题的方法,尽管它不是主要问题

我看到您正在使用版本
我对新版本的插件有不同的问题,这里有人建议使用旧版本,它解决了这个问题。也许你可以试试
。。。此外,您正在使用
,这意味着您需要手动隐藏启动屏幕。对于jquery mobile,在cdn之前在index.html上使用

document.addEventListener(“DeviceRady”,OnDevicerady,false);
函数ondevicerady(){
setTimeout(函数(){
navigator.splashscreen.hide();
}, 2000);
}


我不确定你在用什么平台编码,但这也是一个需要考虑的问题。您也可以尝试使用

我有一个相同的问题,您还没有弄清楚它是什么,但在splashscreen.hide之后,屏幕是黑色的,是人行横道兼容性错误和跳线的splashscreen。我们必须用多少钱才能让它工作,但这不是最好的方法

document.addEventListener(“DeviceRady”,OnDevicerady,false);
//设备API可用
函数ondevicerady(){
navigator.splashscreen.show();
if(导航器.飞溅屏幕){
setTimeout(函数(){
document.getElementById(“fixblack”).innerHTML+='';
navigator.splashscreen.hide();
}, 1000);
}
}


一些代码可能会有帮助,我希望您能理解并感谢您的回答-您所说的“跳线启动屏幕”是什么意思?