Xcode 4.3.1“找不到此可执行文件的有效配置文件”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9681660/
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 4.3.1 "A valid provisioning profile for this executable was not found"
提问by Joel
Tonight I upgraded from Snow Leopard to Lion, and upgraded to Xcode 4.3.1 (iOS 5.1). And now when I try and run debug mode on my device (iPad) I get "A valid provisioning profile for this executable was not found". I have tried every suggestion in past posts on this issue. I have generated a new certificate. I have set my code signing to use the new certificate. I have updated the provisioning profile to use the new certificate. I have gone into the .pbxproj file and deleted all references to the provisioning profile. I have cleaned and closed Xcode a million times. No matter what I do, I still get the same error when trying to run on the device.
今晚我从Snow Leopard 升级到Lion,并升级到Xcode 4.3.1 (iOS 5.1)。现在,当我尝试在我的设备 (iPad) 上运行调试模式时,我收到“找不到此可执行文件的有效配置文件”。我已经尝试了过去关于这个问题的帖子中的每一个建议。我生成了一个新证书。我已将代码签名设置为使用新证书。我已更新配置文件以使用新证书。我已经进入 .pbxproj 文件并删除了对配置文件的所有引用。我已经清理并关闭了 Xcode 一百万次。无论我做什么,尝试在设备上运行时仍然出现相同的错误。
In Organizer, the provisioning profile shows up as "Valid profile" in my Library, but under the Provisioning Profiles listed for the device there are none listed. I have tried clicking the Add button and importing it manually - nothing happens. It doesn't show up. When I click on the device icon in Organizer is says "Provisioning No provisioning profiles". However when I go to my iOS Provisioning Portal online and click on the device, the provisioning profile shows up there as being associated to the device.
在管理器中,配置文件在我的库中显示为“有效配置文件”,但在为设备列出的配置文件下没有列出。我尝试单击“添加”按钮并手动导入它 - 没有任何反应。它没有出现。当我单击管理器中的设备图标时,显示“配置无配置文件”。但是,当我在线转到我的 iOS 配置门户并单击设备时,配置文件会显示为与设备相关联。
Any ideas? I am pulling my hair out here.
有任何想法吗?我在这里拉我的头发。
采纳答案by Joel
The solution that worked for me was:
对我有用的解决方案是:
-Deleted all references to provisioning profile in .pbxproj.
-Deleted all certificates in keychain.
-Imported my certificate to keychain.
-Created new provisioning profile and configured it in developer portal.
-Refreshed provisioning profiles in xcode organizer.
-Deleted the wildcard provisioning profile that xcode automatically adds.
-Went into code signing and selected the signing account associated to the correct provisioning profile.
-Plugged in a different iOS device (switched iPad with for fresh iPhone)
-Built for a new iOS device.
- 删除了 .pbxproj 中对配置文件的所有引用。
- 删除了钥匙串中的所有证书。
- 将我的证书导入钥匙串。
- 创建新的配置文件并在开发人员门户中进行配置。
- 更新了 xcode 管理器中的配置文件。
- 删除了 xcode 自动添加的通配符配置文件。
- 进入代码签名并选择与正确配置文件关联的签名帐户。
- 插入不同的 iOS 设备(更换新 iPhone 的 iPad)
- 为新的 iOS 设备构建。
And it worked. Not sure which step was the magic one. I did not reinstall xcode.
它奏效了。不确定哪一步是神奇的一步。我没有重新安装xcode。
回答by GilroyKilroy
Do you by chance have two developer accounts with different sets of devices/apps? I encountered this situation (see what "iOS Team Provisioning" profile is matching "iPhone Developer"). The only way I have found to switches teams, so to speak, is to select your device and click "Add to Portal" and log in with the correct Apple ID.
您是否偶然拥有两个具有不同设备/应用程序集的开发者帐户?我遇到了这种情况(请参阅“iOS Team Provisioning”配置文件与“iPhone Developer”匹配的内容)。我发现切换团队的唯一方法可以说是选择您的设备并单击“添加到门户”并使用正确的 Apple ID 登录。
回答by Vikings
Make sure there is a valid private and public key generated for the profile. More importantly make sure the keys are stored in the right place in keychain.
确保为配置文件生成了有效的私钥和公钥。更重要的是确保钥匙存储在钥匙串中的正确位置。
They should be under login, not system or any other spot. This was causing and issue for me, and it took me a while to find the solution.
他们应该处于登录状态,而不是系统或任何其他位置。这对我来说是一个原因和问题,我花了一段时间才找到解决方案。
Hope this helps.
希望这可以帮助。
回答by mochasoft
I have seen this problem before, and my "standard" solution is
我以前见过这个问题,我的“标准”解决方案是
a) make a new dummy iOS project , using Xcode menu - file - new - project. Check code signing is your developer certificate. Compile and see if it can run on your iPhone/ipad hardware.
a) 创建一个新的虚拟 iOS 项目,使用 Xcode 菜单 - 文件 - 新建 - 项目。检查代码签名是您的开发人员证书。编译并查看它是否可以在您的 iPhone/ipad 硬件上运行。
If a) fails, it is something with your certificates and keychain. Clear all and make new certificates
如果 a) 失败,则与您的证书和钥匙串有关。清除所有并制作新证书
If b) works, it is something in the .xcodeproj file or build folder for your problem project. Remove all files and folders in build. Use your backup (sure you have a daily backup for your project!!!), and copy an "old" .xcodeproj file to your problem project. Use Xcode - project - clean, xcode - project - build as - testing , and hereafter "run".
如果 b) 有效,则它位于 .xcodeproj 文件或问题项目的构建文件夹中。删除 build.gradle 中的所有文件和文件夹。使用您的备份(确保您的项目每天都有备份!!!),并将“旧”.xcodeproj 文件复制到您的问题项目中。使用 Xcode - project - clean,xcode - project - build as - testing ,然后“运行”。
Before trying above solution, make an extra backup.
在尝试上述解决方案之前,请进行额外备份。
good luck, and remember you are not the first having certificate problems.
祝你好运,记住你不是第一个遇到证书问题的人。
回答by rtovars
In my case the problem was not at all related to keys, certificates, provisioning profiles or any other of the reasons mentioned here and everywhere else. It turns out that some other developer in a different team borrowed the iPad we use and changed the device's date to one year in the future! After I set the correct Date and Time and ran the application on the device everything worked just fine.
就我而言,问题根本与密钥、证书、配置文件或此处和其他任何地方提到的任何其他原因无关。事实证明,不同团队的其他开发人员借用了我们使用的 iPad,并将设备的日期更改为未来一年!在我设置正确的日期和时间并在设备上运行应用程序后,一切正常。
Unfortunately Xcode didn't warn me about this, and it was until I needed to fix another unrelated problem that Instruments informed me of this situation about the wrong date on the device.
不幸的是 Xcode 并没有就此警告我,直到我需要解决另一个不相关的问题,Instruments 才通知我有关设备日期错误的情况。
回答by Denis
Simply check "Code Signing" section in "Build Settings". If you previosly build your app for appstore publication maybe you forgot change from distribution profile to development profile.
只需检查“构建设置”中的“代码签名”部分。如果您之前为 appstore 发布构建应用程序,可能您忘记了从分发配置文件更改为开发配置文件。
回答by us_david
If you are on Xcode 6, and running into this problem when adding a new device (iPhone 5/6), you can follow the steps here:https://stackoverflow.com/questions/22993092/a-valid-provisioning-profile-for-this-executable-was-not-found-error-when-tryi/26153171#26153171
如果您在Xcode中6,并添加新的设备(iPhone 5/6),当运行到这个问题,你可以按照步骤在这里:https://stackoverflow.com/questions/22993092/a-valid-provisioning-profile-for-this-executable-was-not-found-error-when-tryi/26153171#26153171