'Warning: unable to build chain to self-signed root for signer "Apple Distribution

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(3,3): Error: Failed to codesign 'bin/iPhone/Release/PIAMA.iOS.app//Frameworks/Protobuf.framework/Protobuf': Warning: unable to build chain to self-signed root for signer "Apple Distribution: I am getting this error while build app on VS2019 Community for Mac, Xamarin. I have the latest updates for VS & Xamarin.

I also applied the cert mentioned here. https://developer.apple.com/support/expiration

The build goes well when I am in Release mode, but when I change it to Release|iPhone and connect my iPhone I get the following error.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.Shared.targets(3,3): Error: Failed to codesign 'bin/iPhone/Release/[APPNAME].app//Frameworks/protobuf.framework/protobuf': Warning: unable to build chain to self-signed root for signer "Apple Development:

I checked the Project->Options->iOS Bundle Signing ->Signing Identity: Developer. Everything looks good here.

Any help is much appreciated.



Solution 1:[1]

Identifying the bad Certificates:

  1. open KeyChain
  2. Select "Login" select "Certificate" Category under it
  3. Find Apple Certs that has (BLUE + ) icon along with the name (first position)
  4. Double click that certs
  5. Expand the "Trust" section
  6. If it is messed up the "When using this Certificate" option will be selected as "Always Trust" along with the (+) icon

Resolving Bad Certificate problems:

  1. just set "Always Trust" option to "Use System Default"
  2. close small dialog window of keychain. You will be asking for Keychain password . Proceed with that and close
  3. repeat for all Disputed Apple Certificates.
  4. Close Keychain App
  5. Clean/ Deep Clean project in Xcode
  6. That is all / FIXED!!!

** If those type of(Blue Plus +) certificates don't present in Keychain at All when you are facing Warning. Please make change the All Applecertificate setting from " Use System Default" to "Always Trust" close Keychain. again open Keychain then perform above said resole procedure.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NSSurajit