在 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 显示 Hello Cordova 响应 deviceready 事件的示例 Apache Cordova 应用程序。 cordova.io" email="dev@cordova.apache.org"> Apache Cordova Team 但插件信息与我原来的 config.xml 一样 好吧,插件(inappbrowser、电子邮件编写器等)是否在 PGB 上正确加载(检查 PGB 上应用程序上的插件选项卡)。此外,每个属性值内都有奇数空间,例如 src="www/splash/splash.png ".png. 之后不应有空格 我已经回答了我的问题,我不知道问题出在哪里,但在构建数次后删除文件夹结构对我有帮助。 @AjaySuwalka:对于我和其他具有相对路径的人来说,它完全没问题。 我不确定,但它对我不起作用,所以我删除了路径信息并将它们保留在根目录中【参考方案2】:

要解决上述问题, 我将文件夹结构更改为

--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 上的 Hello World

在 PhoneGap Build 中从 Facebook 获取信息

Urban Airship phonegap 3.5 with Phonegap Build

Phonegap Build 3.0 中的谷歌分析

Phonegap Build (config.xml) 和 iPad 闪屏

App phonegap