Jul
06

No iOS code signing key matches provisioning profile

posted on 06 July 2017 in programming

Warning: Please consider that this post is over 6 years old and the content may no longer be relevant.

Recently my team have come up against this error a few times building a Xamarin app using Visual Studio 2017 both on the Mac and PC, and it took a bit to work out the fix.

No iOS code signing key matches specified provisioning profile ‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’

The simplest thing to try is open the properties window (or Options on Mac) of the iOS project, select the ‘iOS Bundle Signing’ tab and change the Signing Identity and Provisioning Profile back to Automatic. Save the project and close and reopen Visual Studio, now set the Signing Identity and Provisioning Profile back to the desired values and rebuild.

iOS Bundle Signing options for iOS Xamarin project

However, if like us this doesn’t fix the problem, open the ProjectName.iOS.csproj file for editing (either in your favourite text editor or by unloading the project first in Visual Studio) and look for the <CodesignProvision> tag. In our case(s) we found there were two entries, which must have been what was confusing Visual Studio.

Duplicate CodesignProvision tags in iOS.csproj file

To fix this, delete one of the entires (and for good measure we cleared the value out of the other entry), now reload the project, open the iOS Bundle Signing options and set the Signing Identity and Provisioning Profile to your desired values. You should now be able to build successfully.