Same problem. Archive in Xcode7 doesn't work.
Does anyone found a workaround?
After many hours of poking with this.. here is what (sort of) worked for me:
1. Manually set Release provisioning profile for watchkit extension and watchkit app
2. try archiving again.
3. if fails, set provisioning profiles back to automatic and try archiving again.
4. if still fails, go back to 1.
It's not like provisioning settings are wrong (it fails both on "auto" and "manual"). It seems that sometimes something gets stuck deep within Xcode and archiving fails with this error. Toggling provisioning settings seems to "unstuck" it for exactly one Archive build (then it just keeps failing with the same error again). But that one successful build passes all store validations and works fine on device via testflight.
PS: Since my app only has watchos1 target, I've tried making an archive on Xcode 6.3 and it worked. Consistently. Which makes me believe that this is Xcode 7 problem.
Having the same issue all of a sudden. It has never given me this error before but starting yesterday, no matter what I do this creeps up. My WatchKit target's name is not the same as the main app (as some have suggested changing it on stackoverflow). Yet, it won't archive. Build works fine and I am able to debug it. Archiving would work randomly at times but now it's constantly giving me this error.
Ok, at the end I spent a few hours implementing every solutions found on the net.
It finally worked, after around 100 separate archiving.
Check out of the project in a new folder + removing spaces from app extension and watch app names + build + change of build number + crash of xcode + build (failed), immediately followed by a build that passed.
This is completely cargo cult. There probably is some transient error / race condition somewhere. I have no idea what triggers it.
After having uploaded the build, I changed the build number and archived. It failed 5 times in a row.
I have the same problem. I am absolutely stuck. Initially, I reconstructed my project from scratch and this worked for a while. Now the project file seems to have gone bad. I'm thinking of trying the following solutions:
1) Go to a backup where things worked and then reinstall my updates one by one.
2) Create a separate XCode project for each target. The problem seems to be related to having more than one target and a WatchOS 1.0 app
3) Continue hacking until I get a build
4) Dropping support for Apple Watch until this bug is fixed.
This bug seems to appear sometimes with device builds. I'm able to work around it by building a second time. However, I have not been able to work around the issue for archiving.
It would be really nice if Apple could fix this bug or at the very least divide this one generic error message into several that are more informative. It would be nice if the message told us, for example, which deployment versions didn't match or which bundle IDs are wrong. It might be nice if a separate code were printed for each case that jumps to the point that prints this error in the ValidateEmbeddedBinary tool.
This bug has wasted a considerable amount of my time. I have a release ready to go but will have to spend a day or two trying to find a work around.
For anyone still struggling with this, I was having this issue and managed to sort it out. For me, it seemed to be caused by a race condition between copying the bundle resources in and verifying the WatchKit app. I was able to fix it permanently by inserting a Run Script build phase to sleep for 5 seconds, in between the "Copy Bundle Resources" and "Embed App Extensions". This is in the main app target.
Looking around, it looks like this error message is a bit of a giant catch-all for different problems, lots of people have found different solutions. One thing to check would be to go into your build/Release-iphoneos folder. Ideally you should be able to see that the main app, watchkit extension and watchkit app are there and also have embedded copies like this:
YourApp WatchKit App.app
YourApp WatchKit Extension.appex
YourApp WatchKit Extension.appex/YourApp WatchKit App.app
YourApp.app/Plugins/YourApp WatchKit Extension.appex
YourApp.app/Plugins/YourApp WatchKit Extension.appex/YourApp WatchKit App.app
If they are all there you may have a race condition like I did. If not, which files are missing should provide a clue to where things are going wrong. Of course build warnings prior to the error message may also provide clues.
I think I found it.
In your app's target's Build Pahses.
Change the order of the "Embed App Extensions" position to right under "Target Dependencies".
In my case it was last after all the other operation, that casued the race condition.
Target dependencies get's your watch extention built before your containing app,
calling embeding right after assures that the race condition it cancelled and seems to fix the problem.