上传带有 xcode 6.0.1 的应用程序后,“您的二进制文件未针对 iPhone 5 进行优化”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26182966/
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
"Your binary is not optimized for iPhone 5" after I upload an app with xcode 6.0.1
提问by Benjamin Toueg
I am getting this email after upload my binary with Xcode Version 6.0.1 (6A317)
使用 Xcode 版本 6.0.1 (6A317) 上传二进制文件后,我收到了这封电子邮件
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 UILaunchImages 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. Learn more about iPhone 5 support and app launch images by reviewing the 'iOS Human Interface Guidelines' at 'https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5' and the 'iOS App Programming Guide' at 'https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW12'.
您的二进制文件未针对 iPhone 5 进行优化 - - 提交的新 iPhone 应用程序和应用程序更新必须支持 iPhone 5 上的 4 英寸显示屏,并且必须包含 UILaunchImages 下的 Info.plist 中引用的启动图像,并将 UILaunchImageSize 值设置为 {320, 568}。启动图像必须是 PNG 文件并位于包的顶层,或者如果您本地化启动图像,则在每个 .lproj 文件夹中提供。通过查看“iOS 人机界面指南”(https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#/ 上的“iOS 人机界面指南”,了解有关 iPhone 5 支持和应用启动图像的更多信息/apple_ref/doc/uid/TP40006556-CH14-SW5'和'iOS App Programming Guide' at 'https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW12'。
Here is my plist file:
这是我的 plist 文件:
Here is my Xcode tree:
这是我的 Xcode 树:
Here is my bundle root tree:
这是我的包根树:
Here is the only resource I could find on this issue but it remains unanswered (3 days old)... https://devforums.apple.com/message/1051948#1051948
这是我在此问题上能找到的唯一资源,但仍未得到答复(3 天前)... https://devforums.apple.com/message/1051948#1051948
回答by Charlie Hung
We faced the same issue and couldn't solve it after trying many solutions, we believe it's a kind of bug in App submission. But we found a workaround which can keep launch images localized and pass the submission verification.
我们遇到了同样的问题,尝试了很多解决方案都无法解决,我们认为这是App提交中的一种错误。但是我们找到了一种解决方法,可以保持启动图像本地化并通过提交验证。
Environment:
环境:
Xcode 6.1 (6A1052c) with iOS 8.1 SDK
带有 iOS 8.1 SDK 的 Xcode 6.1 (6A1052c)
Precondition:
前提:
Have following properties in your "*-info.plist" file.
在“*-info.plist”文件中有以下属性。
Steps:
脚步:
Go to your target's settings and in our standard scenario (localize launch images, which uses "UILaunchImages" in "*-info.plist" but not image assets), it should look like the image
Change the setting to use image assets (Note: after this step, Xcode will automatically REMOVE the "UILaunchImages" properties in your *-info.plist file. So please BACKUP the properties first.)
Go to the "LaunchImage" assets (can click the arrow button on the right) and fill with images from one of your *.lproj folder.
Now, go to the "LaunchImage" folder which contains images and "Contents.json" file.
Remove ALL the launch IMAGESjust added, but keep the "Contents.json" (and it's content) file.
Check the "Contents.json", it should contains properties like image below
转到目标的设置,在我们的标准场景中(本地化启动图像,在“*-info.plist”中使用“UILaunchImages”但不使用图像资产),它应该看起来像图像
更改设置以使用图像资产(注意:在此步骤之后,Xcode 将自动删除 *-info.plist 文件中的“UILaunchImages”属性。因此请先备份属性。)
转到“LaunchImage”资产(可以单击右侧的箭头按钮)并填充来自 *.lproj 文件夹之一的图像。
现在,转到包含图像和“Contents.json”文件的“LaunchImage”文件夹。
删除刚刚添加的所有启动图像,但保留“Contents.json”(及其内容)文件。
检查“Contents.json”,它应该包含如下图所示的属性
Double check following items:
仔细检查以下项目:
Localized launch images in resource folders (en.lproj, ja.lproj, etc.)
*-info.plist contains "UILaunchImages" properties
Project setting uses image asset for launch images
"Contents.json" in "LaunchImage" asset folder, and the folder DOES NOTreally have launch images
资源文件夹(en.lproj、ja.lproj 等)中的本地化启动图像
*-info.plist 包含“UILaunchImages”属性
项目设置使用图像资产作为启动图像
“LaunchImage”资产文件夹中的“Contents.json”,并且该文件夹没有真正的启动图像
Now you can have a try for localized launch images and submit the binary to iTunes Connect. In our App, the workaround did work for "localized launch images" and "submission successful".
现在您可以尝试本地化启动图像并将二进制文件提交到 iTunes Connect。在我们的应用程序中,该解决方法确实适用于“本地化启动图像”和“提交成功”。
It should be a trick for avoiding the bug in submission checking.
这应该是避免提交检查错误的技巧。
Since the workaround above doesn't change any resource, except making the checking thinks we use image assets, we are more convinced that there are some bugs in Apple's checking.
由于上述解决方法不会改变任何资源,除了让检查认为我们使用图像资产之外,我们更确信 Apple 的检查存在一些错误。
Cheers!
干杯!
回答by raz_c
This happened to me too. Since iOS6 (I think) if you localize your app you must be consistent all the way. You have English, Dutch, and French as languages as I see in the screen shot. You must have these languages EVERYWHERE you do localization. Your string localization files must have all these languages but not more languages. I got the same reply when I used AppiRater library for an app. AppiRater has messages in many languages and my app is localized only for 2 languages. So I had to delete all the other string files from AppiRater except the 2 that I needed. Once I did that everything went well.
这也发生在我身上。从 iOS6 开始(我认为)如果您本地化您的应用程序,您必须始终保持一致。正如我在屏幕截图中看到的那样,您有英语、荷兰语和法语作为语言。在您进行本地化的任何地方,您都必须拥有这些语言。您的字符串本地化文件必须包含所有这些语言,但不能包含更多语言。当我将 AppiRater 库用于应用程序时,我得到了相同的答复。AppiRater 有多种语言的消息,我的应用程序仅本地化为 2 种语言。所以我不得不从 AppiRater 中删除所有其他字符串文件,除了我需要的 2 个。一旦我这样做了,一切都很顺利。
So the short answer is: delete any extra localization files that you don't need to support and add localization files that are missing from your app.
所以简短的回答是:删除您不需要支持的任何额外本地化文件,并添加应用程序中缺少的本地化文件。
Cheers!
干杯!
Edit by danielgindi
danielgindi 编辑
This actually works, despite some claims that this answer is irrelevant.
It happened to me when I started using Base localization in an app, and it still had some resources localized in en.lproj
folder, including the Default.png
s.
尽管有人声称此答案无关紧要,但这确实有效。当我开始在应用程序中使用 Base 本地化时,它发生在我身上,它仍然在en.lproj
文件夹中本地化了一些资源,包括Default.png
s。
So you can either make sure that you have the [email protected]
file in allof the localization folders that you are using - or delete localizations that you are not using.
I have just moved everything to be in Base.lproj
, so this way it's clear what png it is taking, and there's no duplicate.
因此,您可以确保[email protected]
在您正在使用的所有本地化文件夹中都有该文件- 或者删除您没有使用的本地化。我刚刚将所有内容都移到了 in 中Base.lproj
,这样就可以清楚地知道它正在使用什么 png,并且没有重复。
回答by Dan Beaulieu
To Be more Clear:
更清楚:
- Change your launch image source to "Launch Image" (follow steps 1-3 in @Charlie Hung's answer).
- 将您的启动图像源更改为“启动图像”(按照@Charlie Hung 的回答中的步骤 1-3)。
- Right click on your project and select 'Show in Finder'
- Find folder Assets.xcassetsand open it
- Open the LaunchImage.launchimagefolder and move your two images to your .Iproj folder which you'll find in your project. (Mine was called Base.Iproj).
- 右键单击您的项目并选择“在 Finder 中显示”
- 找到文件夹Assets.xcassets并打开它
- 打开LaunchImage.launchimage文件夹并将您的两个图像移动到您将在项目中找到的 .Iproj 文件夹。(我的叫做 Base.Iproj)。
Finally, add this to your info.plist (open in text editor):
最后,将此添加到您的 info.plist(在文本编辑器中打开):
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>7.0</string>
<key>UILaunchImageName</key>
<string>iOS7-Default </string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
</array>
This is all I had to do.
这就是我所要做的。
回答by JanB
In my case, I was updating an older app. It turned out I was missing an icon file named: [email protected] with dimensions 320x568. I found this by looking through the warnings. I created the file, added it to my project with the other icon files and it worked fine.
就我而言,我正在更新一个较旧的应用程序。结果我丢失了一个名为:[email protected] 尺寸为 320x568 的图标文件。我通过查看警告发现了这一点。我创建了该文件,将其与其他图标文件一起添加到我的项目中,并且运行良好。
Hope that helps someone :-)
希望对某人有所帮助:-)
回答by mixophrygian
Do what Charlie and Dan recommend AND make sure that your image file names don't have any dashes in it. Mine didn't work until I renamed the files as only alphanumeric.
按照查理和丹的建议进行操作,并确保您的图像文件名中没有任何破折号。直到我将文件重命名为仅字母数字后,我的才起作用。
回答by maledr53
I got the same error, but in my case I didn't had the storyboard (xib) file for the launch image, which is needed:
我遇到了同样的错误,但在我的情况下,我没有启动图像的故事板 (xib) 文件,这是必需的:
"You use a launch XIB or storyboard file to indicatethat your app runs on iPhone 6 Plus or iPhone 6." (see here)
“您使用启动 XIB 或故事板文件来指示您的应用程序在 iPhone 6 Plus 或 iPhone 6 上运行。” (见这里)
I followed this tutorial to create it: https://developer.xamarin.com/recipes/ios/general/templates/launchscreen-xib/
我按照本教程创建它:https: //developer.xamarin.com/recipes/ios/general/templates/launchscreen-xib/
For step 9 of the turorial, in the Info.plist, I set:
对于 turorial 的第 9 步,在 Info.plist 中,我设置:
<key>UILaunchImageFile~iphone</key>
<string>Launch Screen.storyboard</string>
Just to verify, when you run your app, you should see your launch screen image before it loads. After I did this, I was able to upload the app to the app store.
只是为了验证,当您运行您的应用程序时,您应该在加载之前看到您的启动屏幕图像。完成此操作后,我能够将应用程序上传到应用程序商店。
Steps showed above in other answers are also important: "If you also need to support earlier versions of iOS, you can continue to supply static launch images in addition to a launch file." (see here)
上面其他答案中显示的步骤也很重要:“如果您还需要支持早期版本的 iOS,除了启动文件之外,您还可以继续提供静态启动图像。” (见这里)
Hope this helps.
希望这可以帮助。
回答by Shoaib Bagwan
I got the same error in deployment environment 9.3 and swift 2.3 and in my case I didn't had the storyboard (xib) file for the launch image, which is needed and my configuration was wrong in projects target settings, see the image link below:
我在部署环境 9.3 和 swift 2.3 中遇到了同样的错误,在我的情况下,我没有启动图像的故事板 (xib) 文件,这是需要的,而且我在项目目标设置中的配置是错误的,请参阅下面的图像链接:
回答by Spark.Bao
Maybe this is useful for some guys: just change the iOS Deployment Target
from 7.0 to 8.1 or higher.
也许这对某些人有用:只需将iOS Deployment Target
7.0更改为 8.1 或更高版本即可。
I met this problem when I want to upload an app to app store built by react-native 0.37, and its default iOS Deployment Target
is 7.0.
当我想将应用上传到由 react-native 0.37 构建的应用商店时遇到了这个问题,它的默认iOS Deployment Target
值为 7.0。