Cordova Splashscreen在Phonegap构建cli-5.2.0上不工作
我使用Phonegap已经一年多了,直到现在我的Splashscreen还没有问题。我决定从3.7.0迁移到cli-5.2.0(我认为即使是cli-5.1.1,也不会有什么不同),我无法让SplashScreen正常工作Cordova Splashscreen在Phonegap构建cli-5.2.0上不工作,cordova,phonegap-plugins,phonegap-build,splash-screen,Cordova,Phonegap Plugins,Phonegap Build,Splash Screen,我使用Phonegap已经一年多了,直到现在我的Splashscreen还没有问题。我决定从3.7.0迁移到cli-5.2.0(我认为即使是cli-5.1.1,也不会有什么不同),我无法让SplashScreen正常工作 我在cli-5.1.1及更高版本中读到,为了让它工作,您需要npm提供新的splashscreen插件(到目前为止,我所要做的就是指定splashscreen图像的路径) 因此,我的配置文件以如下方式结束: <gap:splash gap:qualifier="p
我在cli-5.1.1及更高版本中读到,为了让它工作,您需要npm提供新的splashscreen插件(到目前为止,我所要做的就是指定splashscreen图像的路径)
因此,我的配置文件以如下方式结束:
<gap:splash gap:qualifier="port-ldpi" gap:platform="android" src="res/screen/android/splash-port-ldpi.png" width="320" height="426" />
<gap:splash gap:qualifier="port-mdpi" gap:platform="android" src="res/screen/android/splash-port-mdpi.png" width="320" height="470" />
<gap:splash gap:qualifier="port-hdpi" gap:platform="android" src="res/screen/android/splash-port-hdpi.png" width="480" height="640" />
<gap:splash gap:qualifier="port-xhdpi" gap:platform="android" src="res/screen/android/splash-port-xdpi.png" width="720" height="960" />
.....
<gap:splash src="res/screen/ios/Default.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="res/screen/ios/Default-568h@2x.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="res/screen/ios/Default-Landscape.png" gap:platform="ios" width="1024" height="748" />
<gap:splash src="res/screen/ios/Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1496" />
<gap:splash src="res/screen/ios/Default-Portrait.png" gap:platform="ios" width="768" height="1004" />
<gap:splash src="res/screen/ios/Default-Portrait@2x.png" gap:platform="ios" width="1536" height="2008" />
<!-- splashscreen delay -->
<preference name="SplashScreenDelay" value="5000" />
<preference name="ShowSplashScreen" value="true" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false"/>
<preference name="phonegap-version" value="cli-5.2.0" />
.....
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen"/>
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<gap:plugin name="cordova-plugin-splashscreen" source="npm" />
.....
.....
我尝试了太多的版本,我甚至都记不起来了。有人知道问题在哪里吗,或者有人提出其他建议吗
我想指定我不使用任何默认的SplashScreen图像(我试图设置一个,但我没有运气。此外,在3.7.0之前,它没有任何用处,所以现在为什么要这样做)并且我不使用任何类型的javascript来显示/隐藏SplashScreen
当我的应用程序启动时,它会显示一个黑屏约5秒(splashscreen应该出现的时间),然后我的应用程序会从第一个屏幕正常启动
编辑:
完整配置文件如下所示
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "hxxp://www.w3.org/ns/widgets"
xmlns:gap = "hxxp://phonegap.com/ns/1.0"
id = "..."
versionCode = "100"
version = "1.0.0">
<name>...</name>
<description>...</description>
<author href="..." email="...">...</author>
<gap:config-file platform="ios" parent="CFBundleShortVersionString">
<string>1.0.0</string>
</gap:config-file>
<!-- ANDROID ICONS -->
<icon density="mdpi" gap:platform="android" src="res/android/icon-48-mdpi.png" width="48" height="48" />
<icon density="hdpi" gap:platform="android" src="res/android/icon-72-hdpi.png" width="72" height="72" />
<icon density="xhdpi" gap:platform="android" src="res/android/icon-96-xhdpi.png" width="96" height="96" />
<icon density="xxhdpi" gap:platform="android" src="res/android/icon-144-xxhdpi.png" width="144" height="144" />
<gap:splash gap:qualifier="port-ldpi" gap:platform="android" src="res/screen/android/splash-port-ldpi.png" width="320" height="426" />
<gap:splash gap:qualifier="port-mdpi" gap:platform="android" src="res/screen/android/splash-port-mdpi.png" width="320" height="470" />
<gap:splash gap:qualifier="port-hdpi" gap:platform="android" src="res/screen/android/splash-port-hdpi.png" width="480" height="640" />
<gap:splash gap:qualifier="port-xhdpi" gap:platform="android" src="res/screen/android/splash-port-xdpi.png" width="720" height="960" />
<!-- IOS ICONS -->
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon-60.png" gap:platform="ios" width="60" height="60" />
<icon src="res/ios/icon-60@2x.png" gap:platform="ios" width="120" height="120" />
<!-- iPad -->
<icon src="res/ios/icon-76.png" gap:platform="ios" width="76" height="76" />
<icon src="res/ios/icon-76@2x.png" gap:platform="ios" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="res/ios/icon-40.png" gap:platform="ios" width="40" height="40" />
<icon src="res/ios/icon-40@2x.png" gap:platform="ios" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon.png" gap:platform="ios" width="57" height="57" />
<icon src="res/ios/icon@2x.png" gap:platform="ios" width="114" height="114" />
<!-- iPad -->
<icon src="res/ios/icon-72.png" gap:platform="ios" width="72" height="72" />
<icon src="res/ios/icon-72@2x.png" gap:platform="ios" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="res/ios/icon-small.png" gap:platform="ios" width="29" height="29" />
<icon src="res/ios/icon-small@2x.png" gap:platform="ios" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="res/ios/icon-50.png" gap:platform="ios" width="50" height="50" />
<icon src="res/ios/icon-50@2x.png" gap:platform="ios" width="100" height="100" />
<gap:splash src="res/screen/ios/Default.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="res/screen/ios/Default-568h@2x.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="res/screen/ios/Default-Landscape.png" gap:platform="ios" width="1024" height="748" />
<gap:splash src="res/screen/ios/Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1496" />
<gap:splash src="res/screen/ios/Default-Portrait.png" gap:platform="ios" width="768" height="1004" />
<gap:splash src="res/screen/ios/Default-Portrait@2x.png" gap:platform="ios" width="1536" height="2008" />
<!-- splashscreen delay -->
<preference name="SplashScreenDelay" value="5000" />
<preference name="ShowSplashScreen" value="true" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="false"/>
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="fullscreen" value="false" />
<preference name="LoadUrlTimeoutValue" value="10000"/>
<preference name="AllowInlineMediaPlayback" value="true"/>
<preference name="KeepRunning" value="true"/>
<access origin="*" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App"/>
</feature>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker"/>
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.Device"/>
</feature>
<feature name="NetworkStatus">
<param name="android-package" value="org.apache.cordova.NetworkManager"/>
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.Notification"/>
</feature>
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen"/>
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser"/>
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<gap:plugin name="cordova-plugin-splashscreen" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
</widget>
...
...
...
1.0.0
编辑2:
今天我在IOS上测试了它。屏幕上会显示splashscreen,但应用程序会在那里死机。它不会在5秒后禁用splashscreen,因为它应该这样做。
我不知道发生了什么事。我将继续使用3.7.0,直到它被解决。我也遇到了同样的问题,但我知道一个简单的方法可以解决您的iOS splashscreen卡住的问题: 在主html文件中:
document.addEventListener("resume", onResume, false);
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
//Hide Splashscreen
navigator.splashscreen.hide();
我知道您提到您不使用js显示/隐藏splashscreen,但对于iOS,您必须:((至少在我的经验中)我也有同样的问题,但我知道有一个简单的方法可以修复您的iOS splashscreen: 在主html文件中:
document.addEventListener("resume", onResume, false);
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
//Hide Splashscreen
navigator.splashscreen.hide();
我知道你提到你不使用js来显示/隐藏splashscreen,但是对于iOS,你不得不:((至少以我的经验来看)这个问题只发生在androids上吗?还是也发生在IPhone上。我这几天都没有带IPhone,但我想在OScan和OScan中都是一样的,你可以共享完整的xml.config文件吗?我在我的初始版本中将其发布在EDITED上question@tzes,我遵循了您提供的链接。响应者Petra通常在问题上是正确的。但是,您的假设是5.1.1和5.2.0是相似的,这是不正确的。在你的config.xml上,功能元素只用于调试。它们不是问题,而是噪音。我会重新阅读文档。我想你没有注意到问题只发生在androids?还是IPhone上。我这几天没有带IPhone,但我想在bo中也是一样的您可以共享完整的xml.config文件吗?我在我的首字母上发布了它question@tzes,我遵循了您提供的链接。响应者Petra通常在问题上是正确的。但是,您认为5.1.1和5.2.0相似的假设是不正确的。在config.xml上,功能元素仅用于调试。它们不是问题所在m、 但是噪音。我会重新阅读文档。我想你错过了