简体   繁体   English

Xcode不会选择正确的配置文件

[英]Xcode won't choose correct Provisioning Profile

I have an app with a distribution certificate with an app id. 我有一个带有应用ID的分发证书的应用。 I have downloaded the distribution profile into my organizer and set the bundle id in info.plist to the app id. 我已将分发配置文件下载到我的管理器中,并将info.plist中的软件包ID设置为app id。 However, when I try to archive the project, I get 但是,当我尝试归档项目时,我明白了

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. Xcode正在查看不同的配置文件,并说这是错误的,但我不想查看该配置文件,我希望它看一个不同的配置文件。 In Build Settings, it even says "(currently matching...) to my correct provisioning profile, so I don't get what's going on. 在Build Settings中,它甚至会将“(当前正在匹配...)”添加到我正确的配置文件中,因此我不知道发生了什么。

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. 谢谢。

I got the same issue last night, worked on it for 5+ hours. 我昨晚得到了同样的问题,工作了5个多小时。 I finally figured it out this morning, turned out I was change the build settings of the project, instead of the target in Xcode... 我终于在今天早上想出来了,原来我改变了项目的构建设置,而不是Xcode中的目标......

I bet you need to delete all provisioning profiles and add all back what need. 我打赌你需要删除所有配置文件并添加所有需要的内容。 That solved this case too. 这也解决了这个问题。

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. 确保info plist中的bundle id与用于在iPhone开发人员中心创建配置文件的bundle id相同。

then make sure the correct profile is selected in the target settings. 然后确保在目标设置中选择了正确的配置文件。

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中遇到了这个问题。我的项目中有两个目标,其中一个总是使用错误的配置文件构建,无论我做了什么(包括更改Build Settings中的Provisioning Profile设置)。

After hours of playing around with it, I noticed the following: 经过几个小时的游戏,我注意到以下几点:

  1. The good target was using a provisioning profile called "XC: com.mycompanyname.mytargetname1" 好的目标是使用名为“XC:com.mycompanyname.mytargetname1”的配置文件
  2. The broken target was using a profile called "XC: ". 破碎的目标使用名为“XC: 的配置文件 This profile is the "Xcode: Wildcard AppID ( )" profile. 此配置文件是“Xcode:通配符AppID( )”配置文件。

I don't know where either of these came from, but what I did to fix my problem was this: 我不知道其中任何一个来自哪里,但我为解决我的问题所做的是:

  1. Log into developers.apple.com 登录developers.apple.com
  2. Go to Certificates, Identifiers & Profiles 转到证书,标识符和配置文件
  3. Clicked on "All" under Provisioning Profiles on the left bar 单击左侧栏上的“配置配置文件”下的“全部”
  4. Clicked on "+" 点击“+”
  5. 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. 创建了一个名为XC: com.mycompanyname.mytargetname2的新配置文件XC: com.mycompanyname.mytargetname2 (注意:设置将特定于您.com.mycompanyname.mytargetname2应替换为您的应用程序的包ID。

After that it worked. 之后它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM