在 https://build.phonegap.com/apps/*****/builds 构建 ipk 时,启动画面和图标未出现在 iOS 中
Posted
技术标签:
【中文标题】在 https://build.phonegap.com/apps/*****/builds 构建 ipk 时,启动画面和图标未出现在 iOS 中【英文标题】:Splash Screen and icons are not appearing in iOS while building ipk at https://build.phonegap.com/apps/*****/builds 【发布时间】:2015-01-10 08:06:29 【问题描述】:您好,当我尝试使用启动画面构建 ipk 并且未出现图标时,我正在 iphone 5s 上检查它。添加的 zip 文件夹的文件夹结构如下。但是每当我在线构建并下载时,安装后它的整个 web.config 都会更改
--config.xml
--www
--icons
--icon-29.png
--icon-40.png
--icon-50.png
--icon-50.png
--<many more>
--splash
--splash_320.png
--splash_640.png
--splash_640x.png
--<many more>
--index.html
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.someapp.someappversionCode = " 1 " version= "1.0.0 " >
<name>Some text</name>
<description>
some text
</description>
<author email="support@example.com" href="http://example.com">
Some text
</author>
<gap:plugin name="org.apache.cordova.inappbrowser " />
<gap:plugin name="de.appplant.cordova.plugin.email-composer " />
<gap:plugin name="org.apache.cordova.splashscreen " />
<gap:plugin name="org.apache.cordova.device " />
<content src="www/index.html " />
<access origin="tel:* " launch-external="yes " />
<preference name="SplashScreen " value="screen " />
<gap:splash src="www/splash/splash.png " />
<preference name="phonegap-version " value="3.6.3 " />
<icon src="www/icons/icon.png " />
<!-- iPhone 6 / 6+ -->
<icon src="www/icons/icon-180.png " gap:platform="ios " />
<!-- iPhone / iPod Touch -->
<icon src="www/icons/icon-60.png " gap:platform="ios " />
<icon src="www/icons/icon-120.png " gap:platform="ios " />
<!-- iPad -->
<icon src="www/icons/icon-76.png " gap:platform="ios " />
<icon src="www/icons/icon-152.png " gap:platform="ios " />
<!-- Settings Icon -->
<icon src="www/icons/icon-29.png " gap:platform="ios " />
<icon src="www/icons/icon-58.png " gap:platform="ios " />
<!-- Spotlight Icon -->
<icon src="www/icons/icon-40.png " gap:platform="ios " />
<icon src="www/icons/icon-80.png " gap:platform="ios " />
<!-- iPhone / iPod Touch -->
<icon src="www/icons/icon-57.png " gap:platform="ios " />
<icon src="www/icons/icon-114.png " gap:platform="ios " />
<!-- iPad -->
<icon src="www/icons/icon-72.png " gap:platform="ios " />
<icon src="www/icons/icon-144.png " gap:platform="ios " />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="www/icons/icon-29.png " gap:platform="ios " />
<icon src="www/icons/icon-58.png " gap:platform="ios " />
<!-- iPad Spotlight and Settings Icon -->
<icon src="www/icons/icon-50.png " gap:platform="ios " />
<icon src="www/icons/icon-100.png " gap:platform="ios " />
<!-- iPhone and iPod touch -->
<gap:splash src="www/splash/splash_320.png " gap:platform="ios " />
<gap:splash src="www/splash/splash_640.png " gap:platform="ios " />
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<gap:splash src="www/splash/splash_640x.png " gap:platform="ios " />
<!-- iPhone 6 -->
<gap:splash src="www/splash/splash_750.png " gap:platform="ios " />
<gap:splash src="www/splash/splash_1242.png " gap:platform="ios " />
<gap:splash src="www/splash/splash_2208.png " gap:platform="ios " />
<!-- iPad -->
<gap:splash src="www/splash/splash_768.png " gap:platform="ios " />
<gap:splash src="www/splash/splash_1024.png " gap:platform="ios " />
<!-- Retina iPad -->
<gap:splash src="www/splash/splash_1536.png " gap:platform="ios " />
<gap:splash src="www/splash/splash_2048.png " gap:platform="ios " />
</widget>
【问题讨论】:
【参考方案1】:如果您打算在 PhoneGap Build 上使用 www/
,您应该从 config.xml 的路径中删除它。查看上面写着的PGB documentation
src:(必需)指定图像文件的位置,相对于您的 www 目录
主要部分是 相对于您的 www 目录,这意味着您现在正在尝试访问文件夹 www/www/icons/
。
【讨论】:
我删除了它仍然无法按预期工作,无法看到启动画面。此外,config.xml 变得毫无意义。 ipk 中的 config.xml 显示要解决上述问题, 我将文件夹结构更改为
--config.xml
--icon-29.png
--icon-40.png
--icon-50.png
--<many more>
--splash
--splash_320.png
--splash_640.png
--splash_640x.png
--<many more>
--index.html
--<other html resources>
并将我的配置文件更改如下
<?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.someapp.someappversionCode = " 1 " version= "1.0.0 " >
<name>Some text</name>
<description>
some text
</description>
<author email="support@example.com" href="http://example.com">
Some text
</author>
<gap:plugin name="org.apache.cordova.inappbrowser " />
<gap:plugin name="de.appplant.cordova.plugin.email-composer " />
<gap:plugin name="org.apache.cordova.splashscreen " />
<gap:plugin name="org.apache.cordova.device " />
<content src="index.html " />
<access origin="tel:* " launch-external="yes " />
<preference name="SplashScreen " value="screen " />
<gap:splash src="splash.png " />
<preference name="phonegap-version " value="3.6.3 " />
<icon src="icon.png " />
<!-- iPhone 6 / 6+ -->
<icon src="icon-180.png " gap:platform="ios " />
<!-- iPhone / iPod Touch -->
<icon src="icon-60.png " gap:platform="ios " />
<icon src="icon-120.png " gap:platform="ios " />
<!-- iPad -->
<icon src="icon-76.png " gap:platform="ios " />
<icon src="icon-152.png " gap:platform="ios " />
<!-- Settings Icon -->
<icon src="icon-29.png " gap:platform="ios " />
<icon src="icon-58.png " gap:platform="ios " />
<!-- Spotlight Icon -->
<icon src="icon-40.png " gap:platform="ios " />
<icon src="icon-80.png " gap:platform="ios " />
<!-- iPhone / iPod Touch -->
<icon src="icon-57.png " gap:platform="ios " />
<icon src="icon-114.png " gap:platform="ios " />
<!-- iPad -->
<icon src="icon-72.png " gap:platform="ios " />
<icon src="icon-144.png " gap:platform="ios " />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="icon-29.png " gap:platform="ios " />
<icon src="icon-58.png " gap:platform="ios " />
<!-- iPad Spotlight and Settings Icon -->
<icon src="icon-50.png " gap:platform="ios " />
<icon src="icon-100.png " gap:platform="ios " />
<!-- iPhone and iPod touch -->
<gap:splash src="splash_320.png " gap:platform="ios " />
<gap:splash src="splash_640.png " gap:platform="ios " />
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<gap:splash src="splash_640x.png " gap:platform="ios " />
<!-- iPhone 6 -->
<gap:splash src="splash_750.png " gap:platform="ios " />
<gap:splash src="splash_1242.png " gap:platform="ios " />
<gap:splash src="splash_2208.png " gap:platform="ios " />
<!-- iPad -->
<gap:splash src="splash_768.png " gap:platform="ios " />
<gap:splash src="splash_1024.png " gap:platform="ios " />
<!-- Retina iPad -->
<gap:splash src="splash_1536.png " gap:platform="ios " />
<gap:splash src="splash_2048.png " gap:platform="ios " />
</widget>
【讨论】:
以上是关于在 https://build.phonegap.com/apps/*****/builds 构建 ipk 时,启动画面和图标未出现在 iOS 中的主要内容,如果未能解决你的问题,请参考以下文章
在 PhoneGap Build 中从 Facebook 获取信息
Urban Airship phonegap 3.5 with Phonegap Build