将构建加载到 iTunes Connect 时出现无效的代码签名权利错误

Invalid Code Signing Entitlements errors when loading build to iTunes Connect

我的 iOS 应用有一个 键盘 和一个 应用组 用于通信。

当我尝试使用 Application Loader 上传构建时,出现以下错误:

ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: 'MYTEAM.iphone.MAINAPP' for the key 'application-identifier' in 'Payload/MAINAPP.app/PlugIns/Keyboard.appex/Keyboard'"

ERROR ITMS-90163: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/MAINAPP.app/PlugIns/Keyboard.appex/Keyboard'."

ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'MYTEAM.iphone.MAINAPP' for key 'application-identifier' in 'Payload/MAINAPP.app/PlugIns/Keyboard.appex/Keyboard' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

所以,很明显,编译键盘的application-identifier是错误的,而且它包含的键aps-environment是多余的。我不明白为什么。我对 Xcode 中的所有标识符、membercenter 中的配置文件和应用程序 ID 进行了三重检查。一切都好。我还删除了所有派生数据、缓存,重新启动 Xcode 几次,但没有帮助。

你可以尝试的是
1- 清理项目,删除您正在使用的所有自定义预编译框架,然后进行构建。希望能解决你的问题。

2- 添加应用程序标识符,在 Entitlements.plist 中指定正确的应用程序包 ID。然后在 Build Options > iOS Bundle Signing

中包含 plist

我在命令行的帮助下从存档中创建了一个 .ipa 文件:

xcodebuild -exportArchive -archivePath $’MyAppArchive.xcarchive’ -exportPath $”MyApp” -exportFormat ipa -exportProvisioningProfile Provisioning_Profile_Name

只指定了一个配置文件。 这就是问题所在。

如果同时为应用程序和键盘指定配置文件 (),问题可能会得到解决。或者您可以像我一样使用 Xcode 简单地创建 .ipa。

清理项目并删除 ~/Library/Developer/Xcode/DerivedData,然后重建对我有用。

这可能是因为在构建设置中 "Code Signing" 发布模式设置为 Developer 这应该是 Distribution。