【问题标题】:Cordova for iOS ERROR ITMS-90022: "Missing required icon file"适用于 iOS 的 Cordova 错误 ITMS-90022:“缺少所需的图标文件”
【发布时间】:2020-04-09 21:26:05
【问题描述】:

我通过 CLI 创建了一个新的 Cordova for iOS 项目并在 Xcode 中打开它。 选择 Archive -> Distribute 后,在上传到 AppStore 过程结束时会出现此错误。

错误 ITMS-90022:“缺少所需的图标文件。捆绑包没有 包含正好为“120x120”的 iPhone / iPod Touch 的应用程序图标 像素,对于 iOS 版本 >= 7.0 为 .png 格式。”

设置:

  • Cordova 版本:9.0.0 (cordova-lib@9.0.1)
  • Xcode 版本:11.2.1
  • macOS 版本:10.15

config.xml

    <?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.app" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Example</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
   <platform name="ios">
   <!-- iOS 8.0+ -->
        <!-- iPhone 6 Plus  -->
        <icon src="res/ios/icon-60@3x.png" width="180" height="180" />
        <!-- iOS 7.0+ -->
        <!-- iPhone / iPod Touch  -->
        <icon src="res/ios/icon-60.png" width="60" height="60" />
        <icon src="res/ios/icon-60@2x.png" width="120" height="120" />
        <!-- iPad -->
        <icon src="res/ios/icon-76.png" width="76" height="76" />
        <icon src="res/ios/icon-76@2x.png" width="152" height="152" />
        <!-- Spotlight Icon -->
        <icon src="res/ios/icon-40.png" width="40" height="40" />
        <icon src="res/ios/icon-40@2x.png" width="80" height="80" />
        <!-- iOS 6.1 -->
        <!-- iPhone / iPod Touch -->
        <icon src="res/ios/icon.png" width="57" height="57" />
        <icon src="res/ios/icon@2x.png" width="114" height="114" />
        <!-- iPad -->
        <icon src="res/ios/icon-72.png" width="72" height="72" />
        <icon src="res/ios/icon-72@2x.png" width="144" height="144" />
        <!-- iPad Pro -->
        <icon src="res/ios/icon-167.png" width="167" height="167" />
        <!-- iPhone Spotlight and Settings Icon -->
        <icon src="res/ios/icon-small.png" width="29" height="29" />
        <icon src="res/ios/icon-small@2x.png" width="58" height="58" />
        <icon src="res/ios/icon-small@3x.png" width="87" height="87" />
        <!-- iPad Spotlight and Settings Icon -->
        <icon src="res/ios/icon-50.png" width="50" height="50" />
        <icon src="res/ios/icon-50@2x.png" width="100" height="100" />
        <!-- iPad Pro -->
        <icon src="res/ios/icon-83.5@2x.png" width="167" height="167" />     
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>

CLI 命令:

cordova create example com.example.app Example
(cd example)
cordova platform add ios 
cordova plugin add cordova-plugin-splashscreen
cordova-icon
cordova-splash

我尝试了什么:清理构建文件夹/更新节点/NPM/更新 Xcode

每个图标都在图像资源文件夹中。如何修复此错误?

【问题讨论】:

  • 粘贴您的 config.xml 或至少粘贴 ios 图标的部分
  • 感谢您的建议,完成

标签: ios xcode cordova app-store-connect


【解决方案1】:

看起来您缺少所有图标的引用。这是您需要在 config.xml 中设置的所有图标的内容,在 ios 节点中

    <icon height="29" platform="ios" src="res/icons/ios/icon-29.png" width="29" />
    <icon height="40" platform="ios" src="res/icons/ios/icon-40.png" width="40" />
    <icon height="48" platform="ios" src="res/icons/ios/icon-48.png" width="48" />
    <icon height="50" platform="ios" src="res/icons/ios/icon-50.png" width="50" />
    <icon height="55" platform="ios" src="res/icons/ios/icon-55.png" width="55" />
    <icon height="57" platform="ios" src="res/icons/ios/icon-57.png" width="57" />
    <icon height="58" platform="ios" src="res/icons/ios/icon-58.png" width="58" />
    <icon height="60" platform="ios" src="res/icons/ios/icon-60.png" width="60" />
    <icon height="72" platform="ios" src="res/icons/ios/icon-72.png" width="72" />
    <icon height="76" platform="ios" src="res/icons/ios/icon-76.png" width="76" />
    <icon height="80" platform="ios" src="res/icons/ios/icon-80.png" width="80" />
    <icon height="87" platform="ios" src="res/icons/ios/icon-87.png" width="87" />
    <icon height="88" platform="ios" src="res/icons/ios/icon-88.png" width="88" />
    <icon height="100" platform="ios" src="res/icons/ios/icon-100.png" width="100" />
    <icon height="114" platform="ios" src="res/icons/ios/icon-114.png" width="114" />
    <icon height="120" platform="ios" src="res/icons/ios/icon-120.png" width="120" />
    <icon height="144" platform="ios" src="res/icons/ios/icon-144.png" width="144" />
    <icon height="152" platform="ios" src="res/icons/ios/icon-152.png" width="152" />
    <icon height="167" platform="ios" src="res/icons/ios/icon-167.png" width="167" />
    <icon height="172" platform="ios" src="res/icons/ios/icon-172.png" width="172" />
    <icon height="180" platform="ios" src="res/icons/ios/icon-180.png" width="180" />
    <icon height="196" platform="ios" src="res/icons/ios/icon-196.png" width="196" />
    <icon height="216" platform="ios" src="res/icons/ios/icon-216.png" width="216" />
    <icon height="1024" platform="ios" src="res/icons/ios/icon-1024.png" width="1024" />

【讨论】:

  • 我需要在根目录下创建 res/icons/ios 文件夹吗?
  • res 文件夹应该已经存在于 cordova 项目的根目录中
  • 我新构建的项目中没有它。最新的 Cordova 版本是否发生了变化,或者我缺少什么?
  • 从未移动过,它不见了,但你可以手动创建它,不会改变任何东西。
  • 试过了,还是遇到同样的错误。我需要为“应用图标和启动图像”选择哪些设置?
猜你喜欢
  • 2023-04-08
  • 2016-09-27
  • 2016-11-21
  • 2017-01-04
  • 1970-01-01
  • 1970-01-01
  • 2019-02-28
  • 2022-10-14
  • 2016-01-16
相关资源
最近更新 更多