ios 配置文件与应用程序标识符权利的权利文件值不匹配

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46148523/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:25:30  来源:igfitidea点击:

Profile doesn't match the entitlements file's value for the application-identifier entitlement

ios

提问by Paul Raymond

I am trying to upload an app to the app store and I am getting this error on the page that has the certs. As far as I can tell I have changed the field so they have matched, but I am missing something.

我正在尝试将应用程序上传到应用程序商店,但在具有证书的页面上出现此错误。据我所知,我已经更改了字段,因此它们匹配,但我遗漏了一些东西。

this is what pops up

这就是弹出的内容

Any help would be greatly appreciated.

任何帮助将不胜感激。

info.plist

信息.plist

回答by samkass

I'm not sure why this fixed it, but I went into my Target's Capabilities tab, turned iCloud ON, tried to do an archive build, it failed, I turned iCloud OFF again, tried to do an Archive build and it succeeded, and after that it was able to automatically resolve certificates again.

我不确定为什么会修复它,但是我进入了目标的功能选项卡,打开了 iCloud,尝试进行存档构建,但失败了,我再次关闭 iCloud,尝试进行存档构建并成功了,并且之后,它能够再次自动解析证书。

回答by Peter Dietz

The app you created has an incorrect application-identifiervalue, for what the provisioning profile is expecting. The cert for appID com.example.foo for the team 2ABCDEFG will be expecting application-identifier: 2ABCDEFG.com.example.foo, your app declared that its appID was com.example.foo, but the application-identifier didn't match, either you are using the wrong team-prefix, or you have the bundleID misconfigured.

您创建的应用程序的application-identifier值不正确,这与配置文件所期望的不同。团队 2ABCDEFG 的 appID com.example.foo 证书将需要应用程序标识符:2ABCDEFG.com.example.foo,您的应用程序声明其 appID 为 com.example.foo,但应用程序标识符不匹配,要么您使用了错误的团队前缀,要么您的 bundleID 配置错误。

In my case, I am using build schemes to allow me to build a prod app and a qa app. com.example.foo for prod, and com.example.foo.qa for QA. I had set my bundleIdentifier in the Info.plist to $(PRODUCT_BUNDLE_IDENTIFIER)$(BUNDLE_SUFFIX), which works great in the simulator and on device for having different apps, however, when the app generates its application-identifer during the archive phase, it must not be reading the bundleIdentifier generated by the Info.plist.

就我而言,我正在使用构建方案来构建一个 prod 应用程序和一个 qa 应用程序。com.example.foo 用于生产,com.example.foo.qa 用于 QA。我已在 Info.plist 中将我的 bundleIdentifier 设置为 $(PRODUCT_BUNDLE_IDENTIFIER)$(BUNDLE_SUFFIX),这在模拟器和设备上运行良好,可以使用不同的应用程序,但是,当应用程序在存档阶段生成其应用程序标识符时,它不得读取由 Info.plist 生成的 bundleIdentifier。

To remedy the situation, I edited FooProject.xcodeproj/project.pbxproj (with a text editor) to change my QA buildSettings PRODUCT_BUNDLE_IDENTIFIER to com.example.foo.qa

为了解决这种情况,我编辑了 FooProject.xcodeproj/project.pbxproj(使用文本编辑器)将我的 QA buildSettings PRODUCT_BUNDLE_IDENTIFIER 更改为 com.example.foo.qa

You can see Apple's Technical Q&A to see their in depth dive into solving this. Once you run the codesign entitlements on your exported app, and see what application-identifier your app was just built with, it should be pretty quick to realize what your are doing wrong. https://developer.apple.com/library/content/qa/qa1879/_index.htmlI didn't find that page in my Google searching, because they don't actually use the phrase from the error message or call the application-identifier by its full name, but instead say App ID.

您可以查看 Apple 的技术问答,了解他们对解决此问题的深入研究。一旦您在导出的应用程序上运行 codesign 授权,并查看您的应用程序刚刚构建时使用的应用程序标识符,应该很快就会意识到您做错了什么。 https://developer.apple.com/library/content/qa/qa1879/_index.html我在谷歌搜索中没有找到那个页面,因为他们实际上没有使用错误消息中的短语或调用应用程序-identifier 按其全名,而是说 App ID。

Also, the solution to this problem isn't to generate a new provisioning profile that has the application-identifier entitlement, it does have that entitlement, however, the value in the provisioning profile, and your app have to match.

此外,此问题的解决方案不是生成具有应用程序标识符权利的新供应配置文件,它确实具有该权利,但是,供应配置文件中的值与您的应用程序必须匹配。

回答by Nidhi

Rightclick on Finder -> Go to Folder...

右键单击 Finder -> 前往文件夹...

~/Library/MobileDevice/Provisioning

For Xcode 11

对于 Xcode 11

~/Library/MobileDevice/Provisioning Profiles/

Delete all provisioning profiles, done.

删除所有配置文件,完成。

回答by mrhangz

Maybe the {project}.entitlements file was missing. Doing what @samkass mentioned will auto generates the file and it will work. So basically just go to capabilities tab, enable anything, and disable it.

也许 {project}.entitlements 文件丢失了。做@samkass 提到的事情会自动生成文件,它会工作。所以基本上只需转到功能选项卡,启用任何内容,然后禁用它。

回答by Sun Set

Changing the iCloud toggle to on, building, and disabling iCloud, got rid of the error saying that:

将 iCloud 切换开关更改为打开、构建和禁用 iCloud,消除了以下错误:

Profile doesn't match the entitlements file's values for the application-identifier and keychain-access-groups entitlements.

配置文件与 application-identifier 和 keychain-access-groups 权利的权利文件值不匹配。

回答by Bijoy Thangaraj

In Xcode 11, this could happen when a .entitlement file is not present for your project. The solution would be to add any random capability by clicking on '+ Capability' under 'Signing & Capabilities' (which leads to the creation of an .entitlement file) and then removing the capability. This will let you automatically provision a certificate too.

在 Xcode 11 中,当您的项目不存在 .entitlement 文件时,可能会发生这种情况。解决方案是通过单击“签名和功能”下的“+ 功能”(这会导致创建 .entitlement 文件)来添加任何随机功能,然后删除该功能。这也将让您自动提供证书。

回答by Tech

Please check your application features which required for your application like In app purchase , push notification , Inter App audio , Siri kitetc.

请检查您的应用程序所需的应用程序功能,如应用程序内购买、推送通知、Inter App 音频、Siri 套件等。

This is the only cause for this type of error.

这是导致此类错误的唯一原因。

Make sure that in your App id the above flags should be on.

确保在您的 App id 中,上述标志应处于打开状态。

Most of time it happens when you not configured push notification , In App purchase in you development App ID.

大多数情况下,当您未配置推送通知时,会发生在您开发的 App ID 中的应用内购买。

回答by Roman

I went into my Target's Capabilities tab, turned Keychain Sharing ON and it starts working

我进入了 Target 的 Capabilities 选项卡,打开了 Keychain Sharing 并开始工作

回答by Alexey Komov

In my case the issue was following: provisioning profile used for build step was created for different app id than provisioning profile used for export step.

在我的情况下,问题如下:用于构建步骤的配置文件是为不同的应用程序 ID 创建的,而不是用于导出步骤的配置文件。

So make sure you're using the same provisioning profile for build and export step.

因此,请确保您对构建和导出步骤使用相同的配置文件。

回答by mikkokut

In Xcode 10, I got it working by moving the entitlements file to correct folder in Project Navigator. I didn't have the entitlements file, but I managed to get one by toggling features on capabilities tab.

在 Xcode 10 中,我通过将权利文件移动到项目导航器中的正确文件夹来使其工作。我没有权利文件,但我设法通过在功能选项卡上切换功能来获得一个。

enter image description here

在此处输入图片说明