This error will appear when you update your provisioning profile in iPhone SDK 2.2
or after the expiration of developer certificate and that you have a new provisioning profile from the developer portal
This is the solution (which is modified from http://www.furmanek.net/54/iphone-sdk-22-codesign-error/)
Suppose you have copied your provisioning profile called "iPhone_Development.mobileprovision" to the Library folder and build & go an old iPhone project called "MyApp", and this annoying error appears
(1)
cd ~/Library/MobileDevice/Provisioning\ Profiles/
(2) find out the UUID of the provisioning profile
strings iPhone_Development.mobileprovision | grep "<string>.*-.*</string>"
output is like this
<string>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
(3) copy that UUID between the string tag
(4) close xcode and go to your project
cd ~/Projects/MyApp/MyApp.xcodeproj
(5) Use a text editor to open the project.pbxproj
find the string PROVISIONING_PROFILE
paste the UUID that you copied from step (3) and put it in both Debug and Release Sections (do multiple finds) for the following line
e.g.
PROVISIONING_PROFILE = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
(6) Launch XCode and open the project and build & go again
Updates :
Deleting all of the lines "PROVISIONING_PROFILE" in project.pbxproj will also fix the problem for iPhone SDK 3 or above
You're my hero !!!!!!
ReplyDeleteThanks so much. This came up in a Google search for the error string and it's been a great help -- the last step I needed before getting my app to run on my iPod Touch. The only info to add is that users should do multiple finds for PROVISIONING_PROFILE, as my pbx file had four separate instances that needed fixing.
ReplyDeleteVery very helpful.
ReplyDeleteA million thanks. I was putting off trying to fix this problem, and you just saved me countless hours of frustration. I even cleaned up a bunch of old, useless PROVISIONING_PROFILE lines while I was there.
ReplyDeleteThe PROVISIONING_PROFILE settings may be vestigial. New projects don't acquire them and simply deleting them fixed it for me; your mileage may vary. Nice of Apple to exclude these from the Info panes. >:-(
ReplyDeleteThank you! That helped me a lot :D
ReplyDeleteI can't imagine how long this would've taken me to fix without this post. Your blogging is much appreciated.
ReplyDeleteAwesome, thank you so much!!!
ReplyDeleteAdd me to the "exceptionally grateful" list. The problem apparently still exists with SDK 2.2.1. I had to update the provisioning profiles to add a developer and all heck broke loose until I found this.
ReplyDeleteI can stop restoring iPhone now.
Doood.... Deleting all of the lines fixed it for me. Thanks a million!
ReplyDeleteI have the same problem but I can't find the project.pbxproj file. Where is it?
ReplyDeleteIt worked!!!! Thank you so much. Now, if you could help me with CSSMERR_TP_NOT_TRUSTED error message that would be perfect. Thanks again.
ReplyDeleteAdrian
You're a life saver this has been screwing me up for a few days now.
ReplyDeleteI'm also very grateful for your post. I can't believe Apple has made it this hard just to change provisioning profiles! I can't wait until I start pushing out beta copies of my app...
ReplyDeletelegend.
ReplyDeleteFantastic! So glad I found this...
ReplyDeletenice collection
ReplyDeleteWow, I was going crazy until I found this and now I finally can test my app on my iPhone again. Thanks so much!!
ReplyDeleteNice post
ReplyDeleteThanks a ton... fixed the problem beautifully. I wouldn't have had a chance of finding it if you hadn't posted this.
ReplyDeleteIn the project file it appears that there are 2 sets of build configs (PBXProject, PBXNativeTarget). When my partner modified the provisioning profile and updated the project for it, it appears that it affected only one of these 2 sets.
ReplyDeleteSo when I did "Get Info" on the target object in the project window, I saw an incorrect/vestigial entry in the Build tab for the code signing identity with the old profile UUID. When I just selected the correct one in the menu, it worked. I have no explanation for how it worked like that in my partner's setup...
Worked with me. Using XCode for OS 3 beta 4. Thank you!
ReplyDeleteThanks a lot! I have to use it a lot, please keep this site online :)
ReplyDeleteincredible awesome post searched the web for hours without avail first class!
ReplyDeleteIt worked for me too, Much Thanks !
ReplyDeleteThanks for this. Definitely helped when changing profiles.
ReplyDeleteAdd me to the "exceptionally grateful" list, too!!! Spend hours before finding your extrem helpful link. THX!
ReplyDeleteI love you! i love internet! :-))))))))
ReplyDelete4 hours lost in my live and in this post i find the solution!!
Thanks!!!
Thank you so much! I lost a whole bunch of time over this, and kept creating and recreating new certificates and provisioning profiles to try and solve it.
ReplyDeleteI just deleted all the PROVISIONING_PROFILE lines and it started compiling! Thank you!
Thank you thank you thank you.
ReplyDeleteThanks so much - you just saved me a huge amount of work. You're a god!!!
ReplyDeleteDoes not work with iphoneOS 3.1.2. Anyone accomplished deleting PROVISIONING_PROFILE worked with xcode 3.1.4 and iphoneOS 3.1.2? Im on 10.5.8 iAtkos. thanks
ReplyDeleteWorked for me too, thanks :-)
ReplyDeleteYOU ARE A GENIUS!!!!!!
ReplyDeleteYou saved me so many hours.... umbelivable!
Thanks!!!
I also had to change lines of the form:
ReplyDelete"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
to
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
as it appeared there were duplicated sections and it did not seem possible to do so from within xcode. (don't ask why as this was for a 3rd party project I downloaded from a book)
Thank you!!! This has saved me twice.
ReplyDeleteWorks like a charm! Wonderful. I wasted one day in fixing this & finally found this to work.
ReplyDeleteThanks a ton.
Works on IOS4 also...
ReplyDeleteI would note that on yourApp.xcodeproj you have to right click and "Show Package Contents" to see the project.pbxproj file.
Also, I didn't delete the lines with PROVISIONING_PROFILE in them. I had...
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
...and replaced "" with my correct profile.
Thanks a million!!!
Thanks for the nice information. I am sure, I will tweet this to my twitter account. This will help a lot of users.
ReplyDeleteSelect xcodeproj in xCode 4. Under "Build Settings", find the "Code Signing" section and choose your developer certificate. Swoosh! The error disappears
ReplyDeleteNice Post. Thanks for sharing
ReplyDelete