Xcode 不会选择正确的配置文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12239212/
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
Xcode won't choose correct Provisioning Profile
提问by SpyMachine
I have an app with a distribution certificate with an app id. I have downloaded the distribution profile into my organizer and set the bundle id in info.plist to the app id. However, when I try to archive the project, I get
我有一个带有应用程序 ID 的分发证书的应用程序。我已将分发配置文件下载到我的管理器中,并将 info.plist 中的包 ID 设置为应用程序 ID。但是,当我尝试归档项目时,我得到
Code Sign error: Provisioning profile '...' specifies the Application Identifier '...' which doesn't match the current setting 'mybundleid'.
代码签名错误:供应配置文件“...”指定了与当前设置“mybundleid”不匹配的应用程序标识符“...”。
Xcode is looking at a different provisioning profile and saying it's wrong, but I don't want to look at that provisioning profile, I want it to look at a different one. In Build Settings, it even says "(currently matching...) to my correct provisioning profile, so I don't get what's going on.
Xcode 正在查看不同的配置文件并说它是错误的,但我不想查看该配置文件,我希望它查看不同的配置文件。在构建设置中,它甚至说“(当前匹配...)到我正确的配置文件,所以我不明白发生了什么。
I also did try removing the wrong profile, but then it gave me another error that the provisioning profile did not exist.
我也确实尝试删除了错误的配置文件,但是它给了我另一个错误,即配置文件不存在。
Does anyone know what I'm missing here? Thanks.
有谁知道我在这里想念什么?谢谢。
回答by devjoe
I got the same issue last night, worked on it for 5+ hours. I finally figured it out this morning, turned out I was change the build settings of the project, instead of the target in Xcode...
我昨晚遇到了同样的问题,研究了 5 个多小时。我今天早上终于想通了,原来我是在更改项目的构建设置,而不是 Xcode 中的目标...
回答by devjoe
回答by Or Arbel
Make sure the bundle id in the info plist, is the same as the one that used to create the profile in iPhone developer center.
确保信息 plist 中的包 ID 与用于在 iPhone 开发人员中心创建配置文件的包 ID 相同。
then make sure the correct profile is selected in the target settings.
然后确保在目标设置中选择了正确的配置文件。
回答by Oz Solomon
I had this problem in XCode 6. I had two targets in my project, and one of them always built with the wrong profile, no matter what I did (including changing the Provisioning Profile setting in Build Settings).
我在 XCode 6 中遇到了这个问题。我的项目中有两个目标,其中一个总是使用错误的配置文件构建,无论我做什么(包括更改构建设置中的配置配置文件设置)。
After hours of playing around with it, I noticed the following:
在玩了几个小时后,我注意到以下几点:
- The good target was using a provisioning profile called "XC: com.mycompanyname.mytargetname1"
- The broken target was using a profile called "XC: ". This profile is the "Xcode: Wildcard AppID ()" profile.
- 好的目标是使用名为“XC:com.mycompanyname.mytargetname1”的配置文件
- 损坏的目标使用了一个名为“XC: ”的配置文件。此配置文件是“Xcode:通配符 AppID ()”配置文件。
I don't know where either of these came from, but what I did to fix my problem was this:
我不知道其中任何一个来自哪里,但是我为解决问题所做的工作是:
- Log into developers.apple.com
- Go to Certificates, Identifiers & Profiles
- Clicked on "All" under Provisioning Profiles on the left bar
- Clicked on "+"
- Created a new profile called
XC: com.mycompanyname.mytargetname2
(NOTE: the settings will be specific to you. The com.mycompanyname.mytargetname2 should be replaced by your app's bundle ID.
- 登录到developers.apple.com
- 转到证书、标识符和配置文件
- 单击左侧栏上的 Provisioning Profiles 下的“All”
- 点击“+”
- 创建了一个名为
XC: com.mycompanyname.mytargetname2
(注意:设置将特定于您。com.mycompanyname.mytargetname2 应替换为您的应用程序包 ID。
After that it worked.
在那之后它起作用了。