ios 无效的 iPhone 应用程序二进制文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47941/
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
Invalid iPhone Application Binary
提问by Kristopher Johnson
I'm trying to upload an application to the iPhone App Store, but I get this error message from iTunes Connect:
我正在尝试将应用程序上传到 iPhone App Store,但我从 iTunes Connect 收到此错误消息:
The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.
您上传的二进制文件是无效的。签名无效,或未使用 Apple 提交证书签名。
Note: The details of original question have been removed, as this page has turned into a repository for all information about possible causes of that particular error message.
注意:原始问题的详细信息已被删除,因为此页面已变成有关该特定错误消息的可能原因的所有信息的存储库。
For general information on submitting iPhone applications to the App Store, see Steps to upload an iPhone application to the AppStore.
有关将 iPhone 应用程序提交到 App Store 的一般信息,请参阅将 iPhone 应用程序上传到 AppStore 的步骤。
采纳答案by Mark Bessey
It's been my experience that Xcode occasionally gets confused about which signing certificate to use. I got into the habit of quitting and restarting Xcode after any change to the code signing settings (and doing a clean build) to work around this problem.
根据我的经验,Xcode 偶尔会对使用哪个签名证书感到困惑。我养成了在对代码签名设置(并进行干净构建)进行任何更改后退出并重新启动 Xcode 以解决此问题的习惯。
回答by Mark Bessey
I just wanted to mention that I too had the problem with zip from the command line as well. The problem lies in the way it handles symlinks by default. Using:
我只想提一下,我也遇到了命令行中的 zip 问题。问题在于它默认处理符号链接的方式。使用:
zip -y -r myapp.zip myapp.app
zip -y -r myapp.zip myapp.app
Solved that problem.
解决了那个问题。
回答by Eddie
I had the same issue and solved it this way:
我遇到了同样的问题并以这种方式解决了它:
The property certificates were installed on my development machine and mobileprovision.embedded was included in the distribution archive. After an hour or so of Googling and digging I found the source the error. Inside Xcode I had copied the Release configuration and created a new Distribution configuration and then changed the signing identity to my distribution certificate. However, even though it was updated in the GUI the project file was not updated correctly.
属性证书安装在我的开发机器上,并且 mobileprovision.embedded 包含在分发存档中。经过一个小时左右的谷歌搜索和挖掘,我找到了错误的根源。在 Xcode 中,我复制了 Release 配置并创建了一个新的 Distribution 配置,然后将签名标识更改为我的分发证书。然而,即使它在 GUI 中更新,项目文件也没有正确更新。
If you come across the same error, look in your [ProjectName].xcodeproj directory for the project.pbxproj file and open it in your favorite editor. Look for the Distribution section. My broken one looked like this:
如果您遇到相同的错误,请在您的 [ProjectName].xcodeproj 目录中查找 project.pbxproj 文件并在您喜欢的编辑器中打开它。查找分发部分。我破碎的那个看起来像这样:
C384C90C0F9939FA00E76E41 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_ENTITLEMENTS = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]” = “iPhone Distribution: Edward McCreary”;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
“PROVISIONING_PROFILE[sdk=iphoneos*]” = “F00D3778-32B2-4550-9FCE-1A4090344400″;
SDKROOT = iphoneos2.2.1;
};
name = Distribution;
};
C384C90D0F9939FA00E76E41 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = “iPhone Developer: Edward McCreary”;
“CODE_SIGN_IDENTITY[sdk=iphoneos*]” = “iPhone Developer: Edward McCreary”;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = GenPass_Prefix.pch;
INFOPLIST_FILE = Info.plist;
PRODUCT_NAME = GenPass;
PROVISIONING_PROFILE = “DB12BCA7-FE72-42CA-9C2B-612F76619788″;
“PROVISIONING_PROFILE[sdk=iphoneos*]” = “DB12BCA7-FE72-42CA-9C2B-612F76619788″;
};
name = Distribution;
};
You can see the signing identity and provisioning profile are incorrect in the second section. Edit it to match the first section, rebuild, and you should be good to go. The final one looked like this:
您可以在第二部分看到签名身份和配置文件不正确。编辑它以匹配第一部分,重建,你应该很高兴。最后一个看起来像这样:
C384C90C0F9939FA00E76E41 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_ENTITLEMENTS = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]” = “iPhone Distribution: Edward McCreary”;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
“PROVISIONING_PROFILE[sdk=iphoneos*]” = “F00D3778-32B2-4550-9FCE-1A4090344400″;
SDKROOT = iphoneos2.2.1;
};
name = Distribution;
};
C384C90D0F9939FA00E76E41 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = “iPhone Distribution: Edward McCreary”;
“CODE_SIGN_IDENTITY[sdk=iphoneos*]” = “iPhone Distribution: Edward McCreary”;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = GenPass_Prefix.pch;
INFOPLIST_FILE = Info.plist;
PRODUCT_NAME = GenPass;
PROVISIONING_PROFILE = “F00D3778-32B2-4550-9FCE-1A4090344400″;
“PROVISIONING_PROFILE[sdk=iphoneos*]” = “F00D3778-32B2-4550-9FCE-1A4090344400″;
};
name = Distribution;
};
guids changed to protect the innocent
指南改变以保护无辜者
回答by Jorge Bernal
Same problem, different solution.
同样的问题,不同的解决方案。
In my case, I was compressing the file using zip -r myapp.zip myapp.app
Turns out, the zip command screwed the bundle. Compressing it from the finder made it work.
就我而言,我正在使用zip -r myapp.zip myapp.app
结果压缩文件,zip 命令搞砸了包。从取景器压缩它使它工作。
回答by Signal2
I had the same issue and after trying several things - I removed the .plist entitlements from the Code Signing Entitlements (just left it blank) and it built fine and uploaded FINALLY.
我遇到了同样的问题,在尝试了几件事之后 - 我从代码签名权利中删除了 .plist 权利(只是将其留空),它构建良好并最终上传。
Good luck all :-D
祝大家好运:-D
回答by Seva Alekseyev
Another data point: for a while, my app went through. Now I've added support for in-app purchases, and suddenly it fails with an "Invalid binary/invalid signature" problem. Upon careful looking, I found out that the value of application-identifier in the entitlements plist file was off.
另一个数据点:有一段时间,我的应用程序通过了。现在我已经添加了对应用内购买的支持,但突然它因“无效的二进制/无效签名”问题而失败。仔细一看,我发现entitlements plist文件中application-identifier的值是off的。
This, most likely, had to do with the fact that I've replaced the provisioning profile from a wildcarded one to a app-specific one (required for in-app purchases). The wrong app ID qualified under the old profile. It did not match the app ID in the info.plist, but apparently iTunes forgave that.
这很可能与我已将配置文件从通配符替换为特定于应用程序的配置文件(应用程序内购买所需)的事实有关。在旧配置文件下限定的错误应用程序 ID。它与 info.plist 中的应用 ID 不匹配,但显然 iTunes 原谅了这一点。
So, to recap:
所以,回顾一下:
info.plist: com.mydomain.foo
dist.plist: com.mydomain.bar
Profile: com.mydomain.*
is OK, while
可以,而
info.plist: com.mydomain.foo
dist.plist: com.mydomain.bar
Profile: com.mydomain.foo
causes "Invalid binary".
导致“无效的二进制文件”。
回答by simon
See this link for the solution:
请参阅此链接以获取解决方案:
http://greghaygood.com/2010/09/04/invalid-binary-message-from-itunesconnect
http://greghaygood.com/2010/09/04/invalid-binary-message-from-itunesconnect
The short answer is that "Eventually I double-checked my info.plist and discovered something. I added CFBundleIconFiles per the new guidelines, but there was an empty entry in the array list. I removed that and re-submitted, and it was finally accepted!"
简短的回答是“最终我仔细检查了我的 info.plist 并发现了一些东西。我根据新指南添加了 CFBundleIconFiles,但数组列表中有一个空条目。我删除了它并重新提交,最后公认!”
回答by Eric
I had the same problem aswell, when building I noticed the provisioning wasn't added in the build.
我也遇到了同样的问题,在构建时我注意到没有在构建中添加配置。
The fix for me was to set the build to the iphone device as where I normally use the simulator, but then it won't include the provisioning profile...
对我来说,修复方法是将构建设置为 iphone 设备,就像我通常使用模拟器的地方一样,但是它不会包含配置文件...
This might be a noob mistake. Normally you can't build to device, but when you do it for distribution you can.
这可能是一个菜鸟错误。通常你不能构建到设备,但是当你做分发时你可以。
回答by Troy Sartain
I tried various things after reading various posts including those above. What finally worked for me was starting completely over! I deleted every certificate and provisioning profile associated with my app.
在阅读了包括上述内容在内的各种帖子后,我尝试了各种方法。最终对我有用的是完全重新开始!我删除了与我的应用程序关联的所有证书和配置文件。
I recreated a new development certificate and a new distribution certificate. I downloaded the intermediate certificate again. Then I recreated both the development profile and the distribution profile.
我重新创建了一个新的开发证书和一个新的分发证书。我再次下载了中间证书。然后我重新创建了开发配置文件和分发配置文件。
After installing the three certificates (I noticed the distribution had both private and public keys this time) and the two provisioning profiles (my distribution profile didn't get flagged as not having a valid certificate!), everything worked.
在安装了三个证书(我注意到这次分发有私钥和公钥)和两个配置文件(我的分发文件没有被标记为没有有效证书!)后,一切正常。
Once I made the decision to revoke everything and just start over, it only took about 5 minutes to create the new stuff and re-install.
一旦我决定撤销所有内容并重新开始,创建新内容并重新安装只需要大约 5 分钟。
回答by Aaron
Here's an issue I ran into: I added the binary to Subversion before uploading. Comparessing/zipping the binary then included the hidden .svn directories, which messed up the code signing.
这是我遇到的一个问题:我在上传之前将二进制文件添加到 Subversion。比较/压缩二进制文件然后包含隐藏的 .svn 目录,这弄乱了代码签名。