xcode 无法将带有情节提要启动图像的应用程序提交到 App Store:您的二进制文件未针对 iPhone 5 进行优化
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27136053/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't submit the app with storyboard launch images to the App Store: Your binary is not optimized for iPhone 5
提问by Dmitry
I am trying to submit my first app to the App Store but when I try I am getting the following error:
我正在尝试将我的第一个应用程序提交到 App Store,但是当我尝试时出现以下错误:
ERROR ITMS-9000: "Your binary is not optimized for iPhone 5 - New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image referenced in the info.plist under UILaunchImage with a UILaunchImageSize value set to {320, 568}. Launch images must be PNG files and located at the top-level of your bundle, or provided within each .lproj folder if you localize your launch images.
错误 ITMS-9000:“您的二进制文件未针对 iPhone 5 进行优化 - 提交的新 iPhone 应用程序和应用程序更新必须支持 iPhone 5 上的 4 英寸显示屏,并且必须包含在 UILaunchImage 下的 info.plist 中引用的具有 UILaunchImageSize 值的启动图像设置为 {320, 568}。启动图像必须是 PNG 文件并位于包的顶层,或者如果您本地化启动图像,则在每个 .lproj 文件夹中提供。
I'm using SDK 8.1. Deployment target is 8.0. Launch images are set by storyboard launch screen file. There is no obsolete launch screen images and I don't plan to add them because target system is iOS 8+.
我正在使用 SDK 8.1。部署目标是 8.0。启动图像由情节提要启动屏幕文件设置。没有过时的启动屏幕图像,我不打算添加它们,因为目标系统是 iOS 8+。
What is wrong? Xcode version 6.1 (6A1052d).
怎么了?Xcode 版本 6.1 (6A1052d)。
采纳答案by Dmitry
Rename storyboard launch screen file to 'LaunchScreen.storyboard'.
将故事板启动屏幕文件重命名为“LaunchScreen.storyboard”。
If you create a new Launch Screen file using File -> New -> File, Xcode will default the name to 'Launch Screen.storyboard'.
如果您使用 File -> New -> File 创建一个新的 Launch Screen 文件,Xcode 将默认名称为“Launch Screen.storyboard”。
However, the default name specified in your Info.plist when creating a new project is 'LaunchScreen.storyboard' without the space.
但是,创建新项目时在 Info.plist 中指定的默认名称是没有空格的“LaunchScreen.storyboard”。
回答by RGML
Does your app support iOS7 or previous? That's the issue. In that case you have to provide the splash screen as PNG files for iOS7.
您的应用是否支持 iOS7 或更低版本?这就是问题所在。在这种情况下,您必须为 iOS7 提供作为 PNG 文件的启动画面。
LaunchScreen.xib or LaunchScreen.storyboard only works with iOS8 onwards.
LaunchScreen.xib 或 LaunchScreen.storyboard 仅适用于 iOS8 以上。
Further information here: http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
更多信息:http: //oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/
With iOS 8, you can now provide an Interface Builder document and, at runtime, have the OS generate all of the necessary Launch Images for you.
在 iOS 8 中,您现在可以提供 Interface Builder 文档,并在运行时让操作系统为您生成所有必要的启动图像。
回答by n.by.n
Here is what worked for me after getting mad for 2 days:
这是我生气了 2 天后对我有用的方法:
- Set Deployment Target to 7.0
- Add a new splash image of size 320x568and name it as Default-568h.png.
- Add the below code in your Info.plist file.
- 将部署目标设置为 7.0
- 添加大小为320x568的新初始图像并将其命名为Default-568h.png。
- 在 Info.plist 文件中添加以下代码。
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
</array>
Points To Ponder
思考要点
- My App was completely in Landscape Mode but I had to use this Portrait sized image of the size given above.
- I had to use 320x568 size which is (1x) although every other resource on my project was retina based i.e (2x)
- One more thing: I did not used Asset Catalogues for Launch Images. I was using a custom sequence of splash screens via my code but still I had to follow above steps to get through this error.
- 我的应用程序完全处于横向模式,但我必须使用上面给出的这个纵向大小的图像。
- 我不得不使用 320x568 大小,即 (1x) 尽管我项目中的所有其他资源都是基于视网膜的,即 (2x)
- 还有一件事:我没有将资产目录用于启动图像。我通过我的代码使用了自定义的闪屏序列,但我仍然必须按照上述步骤来解决这个错误。
Screenshot
截屏
回答by Leon
I had this same error when trying to submit when I was NOTusing a launch screen xib file. I had all the right image assets at the right dimensions but still no.
我在不使用启动屏幕 xib 文件时尝试提交时遇到了同样的错误。我拥有正确尺寸的所有正确图像资产,但仍然没有。
I found this postwhere a chap had the same issue and ended up using a 568x320 file as indicated in the error. I tried the same but this didn't work for me.
我找到了这篇文章,其中一个人遇到了同样的问题,并最终使用了错误中指示的 568x320 文件。我尝试了同样的方法,但这对我不起作用。
In the end, as my app is for iOS8 only, I used a xib file and the app submitted successfully.
最后,由于我的应用程序仅适用于iOS8,因此我使用了一个xib文件并且应用程序提交成功。
回答by user2393018
This issue happens because you don't add launch image whose size is 640x1136 (iphone 5) correctly.
发生此问题是因为您没有正确添加大小为 640x1136 (iphone 5) 的启动图像。
After editing Contents.json below, I can upload to iTunesConnect normally
下面编辑Contents.json后,可以正常上传到iTunesConnect
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "splash-480h.png",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "[email protected]",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "[email protected]",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "[email protected]",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "[email protected]",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "[email protected]",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"filename" : "[email protected]",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "[email protected]",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
回答by Ferdy Fauzi
I'm using React Native, and got this problem after adding react-native-splash-screenplugin
我正在使用 React Native,在添加react-native-splash-screen插件后遇到了这个问题
However, I got the solution after following the method via this link
但是,我通过此链接遵循方法后得到了解决方案
Your binary is not optimized for iPhone 5
The problem has solved when I do this:
当我这样做时,问题已经解决:
- I have removed laungh images' xcassets totally
- added the launch image set
- and added all launch images again
- created a new ipa again
- 我已经完全删除了 laungh 图像的 xcassets
- 添加了启动图像集
- 并再次添加所有启动图像
- 再次创建了一个新的ipa
and this time its successfuly submitted.
这次提交成功了。
回答by Alejandro
For the lost Xamarin souls here, I had this issue by using an images xcassets called Images.xcassets under the Resources folder.
对于这里丢失的 Xamarin 灵魂,我通过在 Resources 文件夹下使用名为 Images.xcassets 的图像 xcassets 来解决这个问题。
I create it from scratch, name it Media.xcassets as it comes from default, and under the root folder, not Resources. And it works. :/
我从头开始创建它,将其命名为 Media.xcassets,因为它来自默认值,位于根文件夹下,而不是 Resources。它有效。:/
回答by theguy
If you refer to https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.htmlit says that iPhone 6(plus) require launch XIB or storyboard file.
如果您参考https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html,它说 iPhone 6(plus) 需要启动 XIB 或故事板文件。
And if you have a look here https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW2it refers the image sizes and never explicitly says that iPhone 5 can handle a launch file (I know it also does not say that it doesn't). At least iPhone 4s looks like it does not, so I guess that iPhone 5 doesn't either and you have to add a static file.
如果您在这里查看 https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW2它指的是图像大小,从不明确说 iPhone 5 可以处理启动文件(我知道它也没有说它不能)。至少 iPhone 4s 看起来没有,所以我猜 iPhone 5 也没有,你必须添加一个静态文件。