The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specif
In my case (using XCode 10.0) nothing worked but this:
File > Project Settings... > Shared Project Settings: > Build System --> Selected "Legacy Build System" instead of the default "New Build System (Default)".