已多次询问过,但我已经尝试了所有提供的解决方案,但仍然无法使其正常工作。
它让我疯狂,因为每次尝试都需要我5分钟(卸载应用程序,构建它,下载它,接受它,安装它,启动它并哭...)
我有一个使用https://build.phonegap.com
构建的phonegap项目在这里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"
xmlns:android="http://schemas.android.com/apk/res/android"
id = "fr.gouv.beta.passculture-staging"
version = "1.0.0" >
<name>My App</name>
<description>My description</description>
<author href="https://example.com" email="email@example.com">
Me
</author>
<access origin="*" />
<gap:config-file platform="android" parent="/manifest">
<application android:debuggable="true" />
</gap:config-file>
<plugin name="cordova-plugin-device" spec="https://github.com/Addarkar/cordova-plugin-cookie-manager.git#51672c23204e1041fca651611aac6bc65a0759e3" />
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="~2.4.1" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<preference name="phonegap-version" value="cli-8.0.0" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreen" value="splash" />
<icon src="icon/ic_launcher_google_play.png" />
<!-- iPhone / iPod Touch -->
<icon src="icon/app-icon-iphone.png" platform="ios" width="60" height="60" />
<icon src="icon/app-icon-iphone@2x.png" platform="ios" width="120" height="120" />
<!-- iPhone 6 / 6+ -->
<icon src="icon/app-icon-iphone@3x.png" platform="ios" width="180" height="180" />
<!-- iPad -->
<icon src="icon/app-icon-ipad.png" platform="ios" width="76" height="76" />
<icon src="icon/app-icon-ipad@2x.png" platform="ios" width="152" height="152" />
<!-- Settings Icon -->
<icon src="icon/app-icon-setting.png" platform="ios" width="29" height="29" />
<icon src="icon/app-icon-setting@2x.png" platform="ios" width="58" height="58" />
<icon src="icon/app-icon-setting@3x.png" platform="ios" width="87" height="87" />
<!-- Spotlight Icon -->
<icon src="icon/app-icon-spotlight.png" platform="ios" width="40" height="40" />
<icon src="icon/app-icon-spotlight@2x.png" platform="ios" width="80" height="80" />
<icon src="icon/app-icon-spotlight@3x.png" platform="ios" width="120" height="120" />
<icon src="icon/ic_launcher_google_play.png" platform="android" qualifier="ldpi" />
<icon src="icon/ic_launcher_mdpi.png" platform="android" qualifier="mdpi" />
<icon src="icon/ic_launcher_hdpi.png" platform="android" qualifier="hdpi" />
<icon src="icon/ic_launcher_xhdpi.png" platform="android" qualifier="xhdpi" />
<icon src="icon/ic_launcher_xxhdpi.png" platform="android" qualifier="xxhdpi" />
<icon src="icon/ic_launcher_xxxhdpi.png" platform="android" qualifier="xxxhdpi" />
<!-- NOT WORKING :( -->
<splash src="splash.png" />
<splash platform="android" qualifier="ldpi" src="splash.png" />
<splash platform="android" qualifier="mdpi" src="splash.png" />
<splash platform="android" qualifier="hdpi" src="splash.png" />
<splash platform="android" qualifier="xhdpi" src="splash.png" />
<!-- iPhone and iPod touch -->
<splash src="Default.png" platform="ios" width="320" height="480" />
<splash src="Default@2x.png" platform="ios" width="640" height="960" />
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<splash src="Default-568h@2x.png" platform="ios" width="640" height="1136" />
<!-- iPhone 6 -->
<splash src="Default-667h@2x.png" platform="ios" width="750" height="1334" />
<splash src="Default-Portrait-736h@3x.png" platform="ios" width="1242" height="2208" />
<splash src="Default-Landscape-736h@3x.png" platform="ios" width="2208" height="1242" />
<!-- iPad -->
<splash src="Default-Portrait.png" platform="ios" width="768" height="1024" />
<splash src="Default-Landscape.png" platform="ios" width="1024" height="768" />
<!-- Retina iPad -->
<splash src="Default-Portrait@2x.png" platform="ios" width="1536" height="2048" />
<splash src="Default-Landscape@2x.png" platform="ios" width="2048" height="1536" />
<!-- Android -->
<splash src="ldpi.png" platform="android" qualifier="ldpi" />
<splash src="mdpi.png" platform="android" qualifier="mdpi" />
<splash src="hdpi.png" platform="android" qualifier="hdpi" />
<splash src="xhdpi.png" platform="android" qualifier="xhdpi" />
<splash src="fr-xhdpi.png" platform="android" qualifier="fr-xhdpi" />
<splash src="portrait-xxhdpi.png" platform="android" qualifier="port-xxhdpi" />
<splash src="landscape-xxhdpi.png" platform="android" qualifier="land-xxhdpi" />
<splash src="xxxhdpi.png" platform="android" qualifier="xxxhdpi" />
</widget>
因此,splash.png
出现在应用的根目录中。我已设置插件<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
,我尝试使用<gap:splash>
标记名称,但请阅读那些不再有用的内容。
所以我尝试了......
有人可以帮忙吗?
答案 0 :(得分:0)
上次尝试过。这是我在config.xml
中所做的更改。不想知道确切地修复了哪一行
<!-- instead of spec="~4.0.1" -->
<plugin name="cordova-plugin-splashscreen" spec="https://github.com/apache/cordova-plugin-splashscreen.git" />
<!-- instead of value="splash" -->
<preference name="SplashScreen" value="screen" />