After I add Today App Extension Target,I become impossible to compile project. below is error:
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: iPhone Developer: (Developer name) (number)
Parent App Signing Certificate: iPhone Developer: (Developer name) (number)
but Embedded binary certificate and parent app's cerificate are the same. So I'm confusing now...
When I had this issue I went to the Apple Member Center and realized that the Provisioning Profile (for the extension) that I had created was marked as 'Invalid'. I just re-created the Provisioning Profile with the same certificate that the app is signed with and then downloaded it via Xcode > Preferences > Account > refresh.
Once I had the new provisioning profiles I selected them in the build settings. I selected the provisioning profile that was just created and also selected the corresponding certificate in the Code signing entity in the build settings and that fixed the issue.
Note that the extension has its own app id and hence its own provisioning profile.
In case this helps anyone, my fix was that I had updated my archive scheme for release when submitting to the store, but never changed it back to adhoc for testing. Editing my archive scheme to use ad hoc worked.
I had to go to:
Xcode-> preferences -> Accounts -> View Details -> select all Provisioning Profiles -> press DEL-key on keyboard after deletion is completed press Download All button!
There are quite a few reasons the issue may emanate from. If none of the other answers are working for you - would like to add another plausible check that helped me. Ensure the certificate you are signing with doesn't have 'Always Trust' (you will see a green '+' sign if the setting is such).
It's especially true if you are using Swift in your project as the 'Always Trust' setting breaks pertinent Swift libraries.
For some reason, my developer certificate was stored in my keychain twice. Deleting one of them fixed the issue.
Open KeyChain Access on your mac, delete the other one certificate that is diff from your own certificate.This issue was general appeared after you loged in another account in your Xcode.