I am trying to build an iOS app in Debug|iPhone configuration on Xamarin Mac, but I am getting:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: Tool exited with code: 1. Output: error: The specified item could not be found in the keychain.
This all started when I had to reset my default keychain and lost my certificates. I've tried fixing it by:
- Creating a new certificate manually (ensuring I had "Apple Worldwide Developer Relations Certification Authority" when requesting the certificate from the certificate authority as suggested here)
- Creating a certificate using xcode 8.3.1 (exporting this certificate onto another machine lets me build fine on that machine)
- Importing my certificates from my old keychain (each time I created a new certificate I ensured to update and download the provisioning profile)
- exporting a working certificate from another user on another machine and importing it onto my machine
- uninstalling Xamarin studio, deleting the folders mentioned here, and installing Xamarin Studio 6.1.3 + Xamarin.iOS 10.4.0.123 (was using 6.1.3 + 10.2.1.5 previously)
- uninstalling Xcode 8.1 and installing Xcode 8.3.1
- installing visual studio for mac (this gave me a different error "EnsureBindingRedirects task failed unexpectedly" - likely a separate bug)
The fact it failed to build when using a known working certificate/provisioning profile combo on another machine leads me to think that Xamarin is having a problem finding the certificate when doing the build, even though it sees the certificate and provisioning profile in Project Options -> iOS Bundle Signing. There could also be an issue in the Keychain somewhere.
Any help on this would be greatly appreciated.