2009-11-19 02:28

协同设计错误: 删除过期配置文件后找不到配置文件

Tried to rebuild an app that was just working yesterday. Got a message that a profile had expired, so I removed it from the iPod and from iTunes. When I chose a new profile (one with an * in the identifier), I now get an error:

Code Sign Error: Provisioning Profile (long string) can't be found.

What am I missing? I looked through related questions and didn't see this scenario already.


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • csdnceshi74 7*4 12年前

    Sometimes your xcode project file gets messed up, especially if you have an old project and first created it with an older version of xcode/iphone sdk. What you need to do is open up the project file in a text editor, search for the 'long string' from your error and manually erase that line. In fact, you should just go ahead and erase any line that points to any provisioning profiles. Then reopen the project in xcode, go to the settings and reselect your new profile. This clears up issues like that most of the time. The lines that point to the provisioning profiles will look like this:

    PROVISIONING_PROFILE = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
    "PROVISIONING_PROFILE[sdk=iphoneos*]" = "487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
    点赞 26 评论 复制链接分享
  • csdnceshi61 derek5. 11年前

    Here's a simpler solution that worked for me and which doesn't require the manual editing of the project file:

    In XCode, in the "Groups & Files" pane, expand "Targets" and double-click on your app's target. This brings up the Info pane for the target. In the "Build" section, check the "code signing" section for any old profiles and replace with the correct one.

    Note that this is different from double-clicking on your project icon and changing the profile from there. Quite amazing :)


    点赞 27 评论 复制链接分享
  • weixin_41568131 10.24 9年前

    To achieve Brad's solution entirely in Terminal, use these commands

    1. cd [Xcode project parent]
    2. vi [Xcode project name].xcodeproj/project.pbxproj
    3. /[offending provisioning profile] [Enter]
    4. dd - delete the entire line
    5. Press n until no more are found
    6. Ctrl+x to save and close
    点赞 10 评论 复制链接分享
  • weixin_41568110 七度&光 10年前

    Just saw a variation on this issue: I went into the project.pbxproj file as per Brad Smith's notes above, except in this case all of the PROVISIONING_PROFILE lines seemed to be correct, with no occurrence of the "bad" profile string that XCode couldn't find.

    However, the fix was the same: deleting ALL of the PROVISIONING_PROFILE lines in project.pbxproj, even though they looked "good" in theory, and then reopening the project in XCode.

    点赞 10 评论 复制链接分享
  • weixin_41568183 零零乙 10年前

    One suggestion I'll make since no one yet has said it: PLEASE PLEASE PLEASE make a backup of your whole .xcodeproj file BEFORE you start modifying it's contents. Screwing up the project file and having no backup will lead to a very very unpleasant experience.

    Being able to back out of an edit can be a godsend.

    点赞 8 评论 复制链接分享
  • weixin_41568127 ?yb? 10年前

    Select the lines in codesigning that are blank under Any iOS SDK and select the right certificate.

    点赞 8 评论 复制链接分享
  • csdnceshi65 larry*wei 9年前

    The solution of Brad Smith worked for me, but I also had to remove the CODE_SIGN_IDENTITY field to make it work.

    点赞 7 评论 复制链接分享
  • csdnceshi57 perhaps? 9年前

    Just spent a hour or so doing this and with the help of Brad's advice and a few additional changes it all worked.

    I've done this using the following: 10.7.3, Xcode 4.3.2, iOS 5.1 btw.

    1) Right click on your myapp.xcodeproj and select package contents

    2) open project.pbxproj with a text editor (don't recommend textedit as it may screw up the formatting)

    3) Scroll all the way down until you find /* Begin XCBuildConfiguration section */

    4) Notice that you have a debug and release sections

    5) In the release section take a look at CODE_SIGN_IDENTITY & "CODE_SIGN_IDENTITY[sdk=iphoneos*]" it should look something like this:

    CODE_SIGN_IDENTITY = "iPhone Distribution: MyCompany LLC";
    "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: MyCompany LLC";

    6) Take a look at PROVISIONING_PROFILE and "PROVISIONING_PROFILE[sdk=iphoneos*]" they should look like this:


    This should match your provisioning profile in Xcode. To see if they match open Xcode > Window > Organizer > Devices > Provisioning Profiles > Right click on the profile > Reveal in Finder > The filename of the .mobileprovision is your profile id.

    7) Scroll down in the project.pbxproj and find a second instance of the release section. The second instance of the release section should end with a comment saying /* End XCBuildConfiguration section */

    8) make sure that the second section matches the first section so that CODE_SIGN_IDENTITY, "CODE_SIGN_IDENTITY[sdk=iphoneos*], and PROVISIONING_PROFILE are all filled in.

    点赞 6 评论 复制链接分享
  • csdnceshi67 bug^君 10年前
    1. Project&Targets Properties -> "Don't Code Sign" -> OK -> cmd+S(or cmd+B);
    2. Project&Targets Properties -> "Your Provision Profile"-> OK

    3. Everything works again!

    点赞 3 评论 复制链接分享
  • csdnceshi56 lrony* 11年前

    In my case the problem was solved by opening Window -> Organizer, selecting my device and removing the old Provisioning Profile under the "Provisioning" panel on the right. The old one was already marked with a red "x" symbol but the iPhone was still using it.

    Besides that profile, also the new one was showing up (with the same name) and after simply relaunching the application I had it running smoothly.

    点赞 1 评论 复制链接分享
  • csdnceshi51 旧行李 10年前

    I just encountered this problem in my XCode4. To fix it, you need to put all the correct provisions into both Debug and Release config.

    I was trying to submit (by archiving) my app. So I just change the Debug provisions to "Don't Code Sign", and the Release provision to my app's appstore provision.

    This fix it and enables me to archive normally. Hope that helps.

    点赞 1 评论 复制链接分享
  • weixin_41568184 叼花硬汉 8年前

    Unfortunately this approach didn't work out for me. But here's a fix which worked for me (to get this to work you need a working project file on Subversion or so):

    I did roll back to an working version of my project file. As it isn't possible to revert with Xcode (Where is the 'Revert' option in Xcode 4's Source Control?) - I used Tortoise, my Windows machine and this Tutorial (http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-howto-rollback.html) to roll back to an older project file.

    As the Tutorial didn't work out for me, I just used Tortoise to save the working revision of my project file to an usb stick to port it to my mac. After that I replaced the new broken project file with the old working one, cleaned and it worked like a charm!

    点赞 评论 复制链接分享
  • csdnceshi78 程序go 8年前

    I was having issues because I updated my AdHoc provisioning profile with some new devices for use on TestFlight. Assumedly this is happening because xcode has an old reference to your provisioning profile in either the codesigning build settings for the project or the targets. The way I fixed mine was to:

    1. Go to both target build settings and project build settings, Under code signing change all the provisioning profiles to something else.
    2. Go to devices/provisioning profiles in the organiser delete the offending profiles, then click the refresh button in the bottom right.
    3. Go back to to the target and project build settings and set your provisioning profiles to the appropriate (hopefully) newly refreshed provisioning profiles.
    点赞 评论 复制链接分享
  • csdnceshi56 lrony* 8年前

    At least in Xcode 5, this is the thing that solved the problem for me:

    Under provisioning profile, select the offending provisioning profile and then select a valid provisioning profile in the pull-down menu.

    enter image description here

    点赞 评论 复制链接分享
  • weixin_41568127 ?yb? 6年前

    You Could remove old reference of provisioning file. Then after import new provisioning Profile and selecting Xcode builder.

    点赞 评论 复制链接分享