xcode - Provisionning profile not found

With XCode, some errors can be very hard to solve and sometimes you can thin that you need to invoke Steve Jobs to help you...

Last time i lost one hour to undertsand why this error happened and i have found a very simpel solution.

The error when you try to deploy on your device : "Provisionning profile not found"

The solution : "Do not use xcode to change the 'code signing identity'. You must close xcode, then open with your favorite editor the file project.pbxproj into the folder of your project myproject.xcodeproj/ .

Edit the line with the variable PROVISIONNING_PROFILE ="AN-HEXA-CODE"; and replace the hexa code with nothing.

Repeat this operation with the next line "PROVISIONNING_PROFILE[sdk=iphones]"="AN-HEXA-CODE"; and save your file.

Then you can reopen your project with xcode and set the good provisionning profile."

This solution has worked for me, i was trying to delete all provisionning profiles, clear my certificates etc. but nothing works. The ugly error was from XCode that can't assign correctly the new value of your provisionning profile into your meta-data of the project.

Hope this will be helpfull for you.