I decided to support both WatchOS 1 and WatchOS 2. Initially, my bundle IDs for the watch targets are created as follows:
WatchKit App: com.company.myapp.watchkitapp
WatchKit Extension: com.company.myapp.watchkitextension
With this setup, build fails with the following error message:
So I changed the bundle IDs to the following format, so that extension's bundle ID is prefixed with watchkit app's bundle ID:
WatchKit App: com.company.myapp.watchkitapp
WatchKit Extension: com.company.myapp.watchkitapp.watchkitextension
Build succeeds. I then try to upload the build to Testflight in preparation for the release, but during the upload process I got the following error:
The error message is clear: I have two periods after the application's bundle ID.
This is very confusing to me. How is it possible that the bundle ID of my extension should be prefixed with watchkit app's bundle ID, and contain only one period after the parent app's bundle ID? The prefix will already have used that one period. How can I satisfy these two conflicting requirements at the same time?
Things I have already tried but not working:
Starting from scratch, creating brand new app ids and provisioning profiles; Deleting all old provisioning profiles from local, re-downloading, then setting the correct code signing and provisioning profiles in target Build Settings in Xcode.
Changing the name of the App ID to match the format of "XC com company myapp", in Member Center.
Quit & restart & clean & rebuild.