I'm trying to run the Apple sample project SimpleWatchConnectivity. I changed the bundle identifiers for all 3 parts to my company's domain (e.g. com.nemesys.simplewatchconnectivity). When I try to run on an iPhone and Apple Watch device, I get this error:
This app contains a WatchKit app with an invalid bundle identifier. The bundle identifier of a WatchKit app must have a prefix consisting of the companion app's bundle identifier, followed by a '.'.
If I add a dot (.) to the WatchKit app, then at build time, I get:
error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.
I have tried a few solutions from answers to other related questions but none worked. Someone having a similar problem to archive and upload to the App Store approved an answer that basically said:
iOS app bundle identifier: com.nemesys.simplewatchconnectivity
WatchKit App bundle identifier: com.nemesys.simplewatchconnectivity.watchkitapp
WatchKit Extension bundle identifier: com.nemesys.simplewatchconnectivity.watchkitapp.watchkitextension
But when I tried those, I got the second error, the embedded binary's bundle identifier is not prefix with the parent app's bundle identifier.
After swapping the identifiers back in fort between the Bundle Identifier and the related identifiers, I got it to work. It's just like a cat and mouse game...