Xcode 9 copy error: executable contains an invalid signature

Am pulling out my hair trying to copy an update via Xcode 9 to an iPhone. Everyone was working great until yesterday when I updated Corona and Xcode. I’ve tried rebuilding with new profiles (all are up-to-date and valid) but keep getting this same error (on an iPad too - both devices are selected when the profile was created). The app runs fine in the Corona and Xcode simulators.

Any ideas would be appreciated. After all these years, I thought I had finally figured out these dreaded profiles… sigh.

Just an update. I removed all profiles and certificates from my Mac and deleted all from my Apple dev account online. Then created a new distribution cert and ad-hoc profile that included both my iPad and iPhone. Re-built the app and tested in both sims. But still can’t copy from Xcode to my devices. Same error: invalid signature.

Any ideas out there?

Solved! The certificate called the Apple Worldwide Developer Relations Certification Authority was somehow removed from my system keychain. I followed the instructions on this page (https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW30) to re-install it and now Xcode 9 is able to copy the app over to my devices. So frustratingly simple! 

Just an update. I removed all profiles and certificates from my Mac and deleted all from my Apple dev account online. Then created a new distribution cert and ad-hoc profile that included both my iPad and iPhone. Re-built the app and tested in both sims. But still can’t copy from Xcode to my devices. Same error: invalid signature.

Any ideas out there?

Solved! The certificate called the Apple Worldwide Developer Relations Certification Authority was somehow removed from my system keychain. I followed the instructions on this page (https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW30) to re-install it and now Xcode 9 is able to copy the app over to my devices. So frustratingly simple!