Phonegap IOS Build没有图标
Posted
技术标签:
【中文标题】Phonegap IOS Build没有图标【英文标题】:Phonegap IOS Build no icons 【发布时间】:2016-07-27 11:37:37 【问题描述】:我正在构建一个应用程序。那拒绝显示图标。当我在 Gulp 中启动它并运行我的波纹时,它不会显示图标。当我将它上传到 Phonagap 版本时,它也不显示图标。
对于我的 CONfig.XML 我有:
<?xml version="1.0" encoding="utf-8"?>
<widget id="be.aarixa.neglectx" version="2.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="" windows-packageVersion="2.2.0.1">
<name>NeglectXMobile</name>
<description>
Neglect-X Mobile
</description>
<gap:config-file platform="ios" parent="CFBundleShortVersionString">
<string>010</string>
</gap:config-file>
<author email="you@example.com" href="http://example.com.com/">
aariXa
</author>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<preference name="KeepRunning" value="True" />
<preference name="ShowTitle" value="True" />
<preference name="InAppBrowserStorageEnabled" value="True" />
<preference name="SuppressesIncrementalRendering" value="True" />
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<plugin name="cordova-plugin-device" spec="~1.1.1" />
<plugin name="cordova-plugin-console" spec="~1.0.2" />
<plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
<plugin name="cordova-plugin-statusbar" spec="~2.1.0" />
<plugin name="ionic-plugin-keyboard" spec="~1.0.8" />
<plugin name="cordova-plugin-file-transfer" version="1.5.1" />
<plugin name="cordova-plugin-file" version="4.1.1" />
<plugin name="cordova-plugin-media" version="2.1.0" />
<plugin name="cordova-plugin-camera" version="2.1.1" />
<plugin name="cordova-sqlite-storage" version="1.2.1"/>
<plugin name="cordova-plugin-keyboard" version="1.1.4" src="https://github.com/cjpearson/cordova-plugin-keyboard" />
<preference name="WindowsStoreDisplayName" value="NeglectXMobile" />
<vs:platformSpecificValues xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps">
<vs:platformSpecificWidget platformName="windows" id="neglectx">
<vs:appxPackageIsForStore>False</vs:appxPackageIsForStore>
<preference name="phonegap-version" value="cli-6.1.0" />
<preference name="windows-appx-target" value="uap" />
<vs:packageOutputPath>D:\Dev\A\neglectx_mobile_2_2\NeglectX_Mobile\AppPackages\</vs:packageOutputPath>
</vs:platformSpecificWidget>
</vs:platformSpecificValues>
<plugin name="cordova-plugin-compat" version="1.0.0" />
<gap:plugin name="cordova-plugin-splashscreen" source="npm"/>
<preference name="phonegap-version" value="cli-5.2.0"/>
<!-- iPhone 6 / 6+ -->
<icon src="resources/ios/icon/icon-60@3x.png" platform="ios" />
<!-- iPhone / iPod Touch -->
<icon src="resources/ios/icon/icon-60.png" platform="ios" />
<icon src="resources/ios/icon/icon-60@2x.png" platform="ios" />
<!-- iPad -->
<icon src="resources/ios/icon/icon-76.png" platform="ios" />
<icon src="resources/ios/icon/icon-76@2x.png" platform="ios" />
<!-- Settings Icon -->
<icon src="resources/ios/icon/icon-small.png" platform="ios" />
<icon src="resources/ios/icon/icon-small@2x.png" platform="ios" />
<!-- Spotlight Icon -->
<icon src="resources/ios/icon/icon-40.png" platform="ios" />
<icon src="resources/ios/icon/icon-40@2x.png" platform="ios" />
<icon src="icon.png"/>
<gap:splash src="splash.png" />
</widget>
我的项目资源视图:
【问题讨论】:
【参考方案1】:我修复了它,GULP 没有添加资源目录,所以我必须将它添加到 zip 中,然后将其上传到 phonegap build。
确保:这是我最新的 config.xml
<?xml version="1.0" encoding="utf-8"?>
<widget id="be.aarixa.neglectx" version="2.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="" windows-packageVersion="2.2.0.1">
<name>NeglectXMobile</name>
<description>
Neglect-X Mobile
</description>
<gap:config-file platform="ios" parent="CFBundleShortVersionString">
<string>010</string>
</gap:config-file>
<author email="you@example.com" href="http://example.com.com/">
aariXa
</author>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<preference name="KeepRunning" value="True" />
<preference name="ShowTitle" value="True" />
<preference name="InAppBrowserStorageEnabled" value="True" />
<preference name="SuppressesIncrementalRendering" value="True" />
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<plugin name="cordova-plugin-device" spec="~1.1.1" />
<plugin name="cordova-plugin-console" spec="~1.0.2" />
<plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
<plugin name="cordova-plugin-statusbar" spec="~2.1.0" />
<plugin name="ionic-plugin-keyboard" spec="~1.0.8" />
<plugin name="cordova-plugin-file-transfer" version="1.5.1" />
<plugin name="cordova-plugin-file" version="4.1.1" />
<plugin name="cordova-plugin-media" version="2.1.0" />
<plugin name="cordova-plugin-camera" version="2.1.1" />
<plugin name="cordova-sqlite-storage" version="1.2.1"/>
<plugin name="cordova-plugin-keyboard" version="1.1.4" src="https://github.com/cjpearson/cordova-plugin-keyboard" />
<preference name="WindowsStoreDisplayName" value="NeglectXMobile" />
<vs:platformSpecificValues xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps">
<vs:platformSpecificWidget platformName="windows" id="neglectx">
<vs:appxPackageIsForStore>False</vs:appxPackageIsForStore>
<preference name="phonegap-version" value="cli-6.1.0" />
<preference name="windows-appx-target" value="uap" />
<vs:packageOutputPath>D:\Dev\A\neglectx_mobile_2_2\NeglectX_Mobile\AppPackages\</vs:packageOutputPath>
</vs:platformSpecificWidget>
</vs:platformSpecificValues>
<plugin name="cordova-plugin-compat" version="1.0.0" />
<gap:plugin name="cordova-plugin-splashscreen" source="npm"/>
<preference name="phonegap-version" value="cli-5.2.0"/>
<icon src="resources/icon.png"/>
<!-- iPhone 6 / 6+ -->
<icon src="resources/ios/icon/icon-60@3x.png" platform="ios" />
<!-- iPhone / iPod Touch -->
<icon src="resources/ios/icon/icon-60.png" platform="ios" />
<icon src="resources/ios/icon/icon-60@2x.png" platform="ios" />
<!-- iPad -->
<icon src="resources/ios/icon/icon-76.png" platform="ios" />
<icon src="resources/ios/icon/icon-76@2x.png" platform="ios" />
<!-- Settings Icon -->
<icon src="resources/ios/icon/icon-small.png" platform="ios" />
<icon src="resources/ios/icon/icon-small@2x.png" platform="ios" />
<!-- Spotlight Icon -->
<icon src="resources/ios/icon/icon-40.png" platform="ios" />
<icon src="resources/ios/icon/icon-40@2x.png" platform="ios" />
</widget>
【讨论】:
以上是关于Phonegap IOS Build没有图标的主要内容,如果未能解决你的问题,请参考以下文章
在 https://build.phonegap.com/apps/*****/builds 构建 ipk 时,启动画面和图标未出现在 iOS 中
phoneGap Build 不会复制 icon.png 和 iPhone 的其他图标
PhoneGap config.xml iOS 应用程序图标问题