I am getting the \'dreaded\' error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning pr
In my case, it looks like Xcode (secretly) reset the Scheme.
I found that the build configuration for Archive was set to Release instead of distribution one, and after I changed it to the correct one, it worked.
I think it is better to check the Schemes as well as the build settings.