uni-app自动生成的ios图标云打包后无法通过审核
uni-app自动生成的ios图标云打包后无法通过审核
报错原因
Error: Unable to validate archive ‘/Documents/downZipPath/eed5add596d14d4c8e1bd09cae32c75d/eed5add596d14d4c8e1bd09cae32c75d.ipa’.
-
Error: Missing Info.plist value. A value for the Info.plist key ‘CFBundleIconName’ is missing in the bundle ‘com.Alma’. Apps built with iOS 11 or later SDK must supply app icons in an asset catalog and must also provide a value for this Info.plist key. For more information see http://help.apple.com/xcode/mac/current/#/dev10510b1f7.
-
Error: Missing required icon file. The bundle does not contain an app icon for iPhone / iPod Touch of exactly ‘120x120’ pixels, in .png format for iOS versions >= 10.0. To support older versions of iOS, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface.
-
Error: Missing required icon file. The bundle does not contain an app icon for iPad of exactly ‘167x167’ pixels, in .png format for iOS versions supporting iPad Pro. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface.
-
Error: Missing required icon file. The bundle does not contain an app icon for iPad of exactly ‘152x152’ pixels, in .png format for iOS versions >= 10.0. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/user_interface.
你好,这个有解决了吗?怎么解决的?
在处理uni-app自动生成的iOS图标云打包后无法通过审核的问题时,通常涉及到图标尺寸、格式、透明度以及是否符合App Store的图标规范。以下是一些可能的原因及相应的代码或配置调整示例,帮助你检查和修正图标问题。
1. 图标尺寸和格式
确保图标的尺寸和格式符合App Store的要求。iOS应用图标通常需要以下几种尺寸:
- 1024x1024px(用于App Store)
- 180x180px(用于iOS设备主屏幕)
检查并生成图标的脚本示例(Node.js):
const sharp = require('sharp');
const generateIcons = async () => {
const inputImagePath = 'path/to/your/source/image.png';
const outputDir = 'path/to/output/dir/';
// Generate 1024x1024px icon
await sharp(inputImagePath)
.resize(1024, 1024)
.toFile(`${outputDir}Icon-AppStore-1024x1024.png`);
// Generate 180x180px icon
await sharp(inputImagePath)
.resize(180, 180)
.toFile(`${outputDir}Icon-60@3x.png`);
console.log('Icons generated successfully.');
};
generateIcons().catch(console.error);
2. 图标透明度
确保图标没有不必要的透明边缘。虽然App Store通常允许一定程度的透明度,但最好检查图标的边缘是否干净。
3. 配置uni-app的manifest.json
在manifest.json
中正确配置图标路径:
{
"mp-weixin": {},
"app-plus": {
"distribute": {
"apple": {
"icon": "/static/icon/icon-1024.png" // 确保路径正确
}
}
},
// ...其他配置
"iconPath": "/static/icon/icon.png", // 主图标路径
// ...其他配置
}
4. 使用Xcode检查
在提交前,使用Xcode打开生成的ipa文件,检查Xcode中的Assets.xcassets是否包含正确尺寸的图标,并确保没有警告或错误信息。
5. 清理和重建
有时候,简单的清理和重建项目可以解决缓存导致的问题。确保在提交前执行完整的构建流程。
# 假设你使用的是HBuilderX
hbuilderx clean
hbuilderx run -p ios --cloud
通过上述步骤,你应该能够检查和修正uni-app自动生成的iOS图标在云打包后无法通过审核的问题。如果问题依旧存在,建议查阅最新的App Store图标规范,或联系苹果开发者支持获取更具体的反馈。