iPhone SDK 2.2 - CodeSign Error
My weekend work plans were simple.
- Update iphone sdk to 2.2
- Write some more functionality for my FitTimer app.
Unfortunately the second part of my plan was never started because updating the SDK took most of my Saturday and Sunday.
The official update was not very difficult but after I have installed SDK 2.2 and updated my test devices I no longer was able to install my apps. I have gotten this nasty CodeSign error:
"CodeSign error: a valid provisioning profile is required for product type 'Application' in SDK 'Device - iPhone OS 2.2"
I have done everything from adjusting project settings to regenerating certificates and provisioning profiles. I have not gotten much traction with any of my efforts. The solution came after I have found a post claiming there is a bug in SDK2.2 that causes for the project files to get corrupted.
So I have pulled out my trusty (MacVim) editor and opened up the: ProjectName.xcodeproj/project.pbxproj file and started snooping around.
I have found that I had multiple Build Configuration sections and my
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
entry had a different number then my installed provisioning profiles.
So here are the steps to get it working again:
- SAVE YOUR WORK JUST IN CASE THIS SOLUTION DOES NOT WORK FOR YOUR PROBLEM
- Save your old project file.
- Go to ~/Library/MobileDevices/Provisioning Profiles
- Figure out which profile is the one relating to your project. Sometimes the profiles are saved with UUID as the file name so you may have to run grep with your project’s name to figure out which one it is.
- Copy the xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx number.
- Save your current work and close XCode
- Go to
yourProjectDirectory/ProjectName.xcodeproj/and using a text editor (MacVim for me) open theproject.pbxprojfile - Find all
"PROVISIONING_PROFILE[sdk=iphoneos*]“entries and replace the assignment value with the number you have copied in step 4. - Save the project.pbxproj file
- Reopen Xcode and recompile your projects. The CodeSign error should be gone.
$ grep myAppName * Binary file xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.mobileprovision matches
I hope this helps and saves you a lot of time.
Good luck and if you have some time please check out my app: FitTimer
Updated: [important]
Please read Big3’s post https://devforums.apple.com/message/15497 and file bug report with apple. Send them your saved project file so they can figure out why XCode projects are getting corrupted.



Social Networking