解决 React Native iOS 缺少 iPad 图标错误(152x152 / 167x167 验证失败)

解决 React Native iOS 缺少 iPad 图标错误(152x152 / 167x167)



在提交 React Native iOS 应用到 App Store 时,如果你遇到类似错误:

Missing required icon file.
The bundle does not contain an app icon for iPad of exactly '152x152' pixels
The bundle does not contain an app icon for iPad Pro of exactly '167x167' pixels

这个问题看起来很奇怪,因为你的 Xcode 项目中已经显示支持 iPad。

🔍 现象

你可能已经看到:

  • Deployment Info 中有 iPad 配置
  • iPad Orientation 已启用

但是打开 Assets.xcassets → AppIcon 时:

  • ❌ 没有 iPad 图标槽位

最终导致 App Store 校验失败。

🧠 根本原因

这是因为配置不一致导致的:

  • 项目设置支持 iPad ✅
  • AppIcon 资源仍然是 iPhone-only ❌

在很多 React Native 项目中,默认生成的 AppIcon 并不包含 iPad 图标槽位。

✅ 解决方案(最简单有效)

重新创建 AppIcon:

  1. 打开 Assets.xcassets
  2. 删除当前的 AppIcon
  3. 右键 → New App Icon
  4. 命名为 AppIcon

新的 AppIcon 会自动包含:

  • iPad 图标(152x152)
  • iPad Pro 图标(167x167)

🖼️ 必须提供的图标

你至少需要提供:

  • 152 × 152(iPad)
  • 167 × 167(iPad Pro)

将对应 PNG 图片拖入即可。

⚠️ 重要检查

确保项目确实支持 iPad:

Build Settings → Targeted Device Family = 1,2

含义:

  • 1 = iPhone
  • 2 = iPad

🚀 如果你不打算支持 iPad

可以直接关闭 iPad 支持:

Targeted Device Family = 1

并在 Info.plist 中:

<key>UIDeviceFamily</key>
<array>
  <integer>1</integer>
</array>

这样就不会再要求 iPad 图标。

💡 为什么 React Native 容易踩这个坑

React Native 的模板有时没有及时跟上 Xcode 的更新,导致资源配置(Asset Catalog)与项目设置不一致,从而在提交 App Store 时出现校验错误。

✅ 结果

完成上述修改后:

  • ✅ 校验通过
  • ✅ 可以正常上传 App Store

一个 2 分钟的修复,可能帮你省下 2 小时的排查时间。

❤️ Support This Blog


If this post helped you, you can support my writing with a small donation. Thank you for reading.


Comments

Popular posts from this blog

fixed: embedded-redis: Unable to run on macOS Sonoma

Copying MDC Context Map in Web Clients: A Comprehensive Guide

Reset user password for your own Ghost blog