phoneGap Build 不会复制 icon.png 和 iPhone 的其他图标
Posted
技术标签:
【中文标题】phoneGap Build 不会复制 icon.png 和 iPhone 的其他图标【英文标题】:phoneGap Build not copying over icon.png and other icons for iPhone 【发布时间】:2015-08-26 13:24:56 【问题描述】:我在复制 ios 版本的图标时遇到了不一致的问题。具体来说,默认图标不会被复制,但其他图像(6.0 版)会被复制。
phonegap 构建文件夹结构的布局是 根 - 水库 - 图标 - IOS - *.png - 屏幕 - 应用程序 - (角度文件夹) - 内容 -CSS - 图像 - js 索引.html 配置文件 *.png
当我加载到我的开发 iPad 时,这在本地工作(并按预期显示图标),但被苹果审核流程拒绝。
日志文件在这里:https://build.phonegap.com/apps/1415919/logs/ios/build/ 编译后的文件在这里:https://build.phonegap.com/apps/1415919/share
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.mbienergyservices.employment" version="1.0.0">
<name>MBI Works!</name>
<description>Find your career at MBI</description>
<author href="http://mbienergyservices.com" email="support@mbienergyservices.com">James Fleming</author>
<content src="index.html"/>
<preference name="phonegap-version" value="3.7.0" />
<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<preference name="target-device" value="universal"/>
<preference name="fullscreen" value="true"/>
<preference name="webviewbounce" value="true"/>
<preference name="prerendered-icon" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<preference name="detect-data-types" value="true"/>
<preference name="exit-on-suspend" value="false"/>
<preference name="show-splash-screen-spinner" value="true"/>
<preference name="auto-hide-splash-screen" value="true"/>
<preference name="disable-cursor" value="false"/>
<preference name="android-minSdkVersion" value="7"/>
<preference name="android-installLocation" value="auto"/>
<gap:splash src="splash.png" />
<icon src="res/icon/android/mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="res/icon/android/hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="res/icon/android/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="res/icon/android/xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
<icon src="res/icon/android/xxxhdpi.png" gap:platform="android" gap:qualifier="xxxhdpi" />
<platform name="android">
<!-- you can use any density that exists in the Android project -->
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi"/>
<gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:qualifier="port-mdpi"/>
<gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:qualifier="port-hdpi"/>
<gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xhdpi"/>
<icon src="res/icon/android/hdpi.png" density="hdpi" />
<icon src="res/icon/android/ldpi.png" density="ldpi" />
<icon src="res/icon/android/mdpi.png" density="mdpi" />
<icon src="res/icon/android/xhdpi.png" density="xhdpi" />
<icon src="res/icon/android/xxhdpi.png" gap:qualifier="xxhdpi" />
<icon src="res/icon/android/xxxhdpi.png" density="xxxhdpi" />
<!-- icon -->
</platform>
<platform name="ios">
<!-- iOS legacy -->
<!-- iPhone -->
<icon src="icon.png" gap:platform="ios" />
<icon src="icon@2x.png" gap:platform="ios" />
<icon src="icon-72@2x.png" gap:platform="ios" />
<!-- iPhone 6 / 6plus -->
<icon src="icon-60@3x.png" gap:platform="ios" />
<!-- iPhone / iPod Touch -->
<icon src="icon-60.png" gap:platform="ios" />
<icon src="icon-60@2x.png" gap:platform="ios" />
<!-- iPad -->
<icon src="icon-76.png" gap:platform="ios" />
<icon src="icon-76@2x.png" gap:platform="ios" />
<!-- Settings Icon -->
<icon src="icon-small.png" gap:platform="ios" />
<icon src="icon-small@2x.png" gap:platform="ios" />
<!-- Spotlight Icon -->
<icon src="icon-40.png" gap:platform="ios" />
<icon src="icon-40@2x.png" gap:platform="ios" />
<!-- iOS 6.1 -->
<!-- iPhone / iPod Touch -->
<icon src="icon-57.png" gap:platform="ios" />
<!-- iPad -->
<icon src="icon-72.png" gap:platform="ios" />
<icon src="icon-72-2x.png" gap:platform="ios" />
<icon src="icon-72@2x.png" gap:platform="ios" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="icon-small.png" gap:platform="ios" />
<icon src="icon-small@2x.png" gap:platform="ios" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="icon-50.png" gap:platform="ios" />
<icon src="icon-50@2x.png" gap:platform="ios" />
</platform>
<icon src="icon.png"/>
<icon src="res/icon/webos/icon-64.png" gap:platform="webos"/>
<icon src="res/icon/windows-phone/icon-48.png" gap:platform="winphone"/>
<icon src="res/icon/windows-phone/icon-173-tile.png" gap:platform="winphone" gap:role="background"/>
<!-- splash -->
<gap:splash src="res/screen/blackberry/screen-225.png" gap:platform="blackberry"/>
<gap:splash src="res/screen/ios/Default.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" />
<!-- iPad -->
<gap:splash src="res/screen/ios/Default-Portrait.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape.png" gap:platform="ios" />
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<gap:splash src="res/screen/ios/Default-568h@2x.png" gap:platform="ios" />
<!-- iPhone 6 -->
<gap:splash src="res/screen/ios/Default-667h@2x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Portrait-736h@3x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape-736h@3x.png" gap:platform="ios" />
<!-- Retina iPad -->
<gap:splash src="res/screen/ios/Default-Portrait@2x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape@2x.png" gap:platform="ios" />
<access origin="*" subdomains="true" />
</widget>
【问题讨论】:
【参考方案1】:我终于让它工作了。我认为问题在于我在平台标签中有图标。
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.mbienergyservices.employment" version="1.0.0">
<name>MBI Works!</name>
<description>Find your career at MBI</description>
<author href="http://mbienergyservices.com" email="support@mbienergyservices.com">James Fleming</author>
<content src="index.html"/>
<preference name="phonegap-version" value="3.7.0" />
<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<platform name="ios">
<preference name="target-device" value="universal"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<preference name="detect-data-types" value="true"/>
<preference name="prerendered-icon" value="true"/>
<preference name="exit-on-suspend" value="false"/>
<preference name="deployment-target" value="7.0" />
</platform>
<preference name="fullscreen" value="true"/>
<preference name="webviewbounce" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="show-splash-screen-spinner" value="true"/>
<preference name="auto-hide-splash-screen" value="true"/>
<preference name="disable-cursor" value="false"/>
<preference name="android-minSdkVersion" value="7"/>
<preference name="android-installLocation" value="auto"/>
<gap:splash src="splash.png" />
<icon src="res/icon/android/mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="res/icon/android/hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="res/icon/android/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="res/icon/android/xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
<icon src="res/icon/android/xxxhdpi.png" gap:platform="android" gap:qualifier="xxxhdpi" />
<platform name="android"></platform>
<!-- you can use any density that exists in the Android project -->
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi"/>
<gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:qualifier="port-mdpi"/>
<gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:qualifier="port-hdpi"/>
<gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:qualifier="port-xhdpi"/>
<icon src="res/icon/android/hdpi.png" density="hdpi" />
<icon src="res/icon/android/ldpi.png" density="ldpi" />
<icon src="res/icon/android/mdpi.png" density="mdpi" />
<icon src="res/icon/android/xhdpi.png" density="xhdpi" />
<icon src="res/icon/android/xxhdpi.png" gap:qualifier="xxhdpi" />
<icon src="res/icon/android/xxxhdpi.png" density="xxxhdpi" />
<!-- icon -->
<icon src="icon.png"/>
<!-- iOS legacy -->
<!-- iPhone -->
<icon src="www/icon.png" gap:platform="ios" />
<icon src="www/icon@2x.png" gap:platform="ios" />
<icon src="www/icon-72@2x.png" gap:platform="ios" />
<!-- iPhone 6 / 6plus -->
<icon src="icon-60@3x.png" gap:platform="ios" />
<!-- iPhone / iPod Touch -->
<icon src="icon-60.png" gap:platform="ios" />
<icon src="icon-60@2x.png" gap:platform="ios" />
<!-- iPad -->
<icon src="icon-76.png" gap:platform="ios" />
<icon src="icon-76@2x.png" gap:platform="ios" />
<!-- Settings Icon -->
<icon src="www/icon-small.png" gap:platform="ios" />
<icon src="www/icon-small@2x.png" gap:platform="ios" />
<!-- Spotlight Icon -->
<icon src="www/icon-40.png" gap:platform="ios" />
<icon src="www/icon-40@2x.png" gap:platform="ios" />
<!-- iOS 6.1 -->
<!-- iPhone / iPod Touch -->
<icon src="icon-57.png" gap:platform="ios" />
<!-- iPad -->
<icon src="icon-72.png" gap:platform="ios" />
<icon src="icon-72-2x.png" gap:platform="ios" />
<icon src="icon-72@2x.png" gap:platform="ios" />
<icon src="res/icon/webos/icon-64.png" gap:platform="webos"/>
<icon src="res/icon/windows-phone/icon-48.png" gap:platform="winphone"/>
<icon src="res/icon/windows-phone/icon-173-tile.png" gap:platform="winphone" gap:role="background"/>
<!-- splash -->
<gap:splash src="res/screen/blackberry/screen-225.png" gap:platform="blackberry"/>
<gap:splash src="res/screen/ios/Default.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" />
<!-- iPad -->
<gap:splash src="res/screen/ios/Default-Portrait.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape.png" gap:platform="ios" />
<!-- iPhone 5 / iPod Touch (5th Generation) -->
<gap:splash src="res/screen/ios/Default-568h@2x.png" gap:platform="ios" />
<!-- iPhone 6 -->
<gap:splash src="res/screen/ios/Default-667h@2x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Portrait-736h@3x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape-736h@3x.png" gap:platform="ios" />
<!-- Retina iPad -->
<gap:splash src="res/screen/ios/Default-Portrait@2x.png" gap:platform="ios" />
<gap:splash src="res/screen/ios/Default-Landscape@2x.png" gap:platform="ios" />
<access origin="*" subdomains="true" />
</widget>
【讨论】:
以上是关于phoneGap Build 不会复制 icon.png 和 iPhone 的其他图标的主要内容,如果未能解决你的问题,请参考以下文章
PhoneGap Build 应用程序不会触发与电池相关的事件
来自phonegap build的.ipa不会安装在iphone上
如果关闭位置服务,Phonegap build "deviceready" 事件永远不会触发