Trying to build an iOS 9/watchOS 2 app for AdHoc distribution but keep getting code signing issues

So I'm trying to build my app for distribution for AdHoc beta testing, but I keep running into code signing issues. Building and running on decide (both phone and watch) work fine, but when I try to create an AdHoc distribution build, I run into this 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: Not Code Signed
  Parent App Signing Certificate: iPhone Distribution: [My signing certificate]


I get this error during the step where it is validating the embedded WatchKit App binary.


I've tried to follow the instructions creating a Distribution signing certificate, installing it, and then creating AdHoc provisioning profiles for each of my iOS app, the WatchKit app, and the WatchKit extension. I set the code signing identity for the release build setting for all three to my distribution certificate, and I've set the provisioning profiles for all three to their respective AdHoc profiles, but I keep getting this error.


I double checked my WatchKit App target and the code signing identity and provisioning profile are definitely there, so I'm not sure why it's complaining that it's not code signed.

Replies

I get the exact same error. Pretty sure it's a bug in Xcode 7B3 because I've checked my certs backwards and forwards.

Good to know someone else is having this problem. I've been at this for hours and it all looks good in Xcode.

Are you aware of a way to just exclude the watchkit app from the archive task?

I was struggling with this same issue. I was using flurry for analytics, which hadn't been compiled for bitcode. I thought that I would just turn off bitcode for the app, but keep it on for the watch extension. The error message it kept giving me was something about signing with different identities. Once I removed flurry and set bitcode to "on" on both the app and the watch extension, everything signed correctly.


It meant I had to remove pod files that weren't compiled for bitcode, but I got it to work.


Your problem may be something different, but maybe someone else will run into the same problem I had.

Actually that is probably the cause. I had to turn off bitcode because I am using the Realm Pod. They said they aren't going to turn it back on until closer to the public release, so I guess I'll have to hold tight.

This was exactly my issue. Bitcode turned off for main App but not Extension.


All that time spent double checking my certs and code signing only to find out I needed to also disable Bitcode for my Extension .. *sigh*


Thanks for the pointer.

I thought Apple were requiring BitCode to be enabled for watchOS 2?

This is an Xcode bug and continues in beta 4. The problem is you can't disable Bitcode for WatchOS 2. If you enable Bitcode for WatchOS, your Archive build will fail because your parent app doesn't use Bitcode even though the parent app does not require Bitcode. I have not yet filed this in Radar (too many other issues in B4 to deal with.) Please post here if someone files. Should be cross-filed to openradar imo.

Hi, we are also experiencing the exact same issue and it appears to us that this a total blocker for actually distributing an app with Bitcode disabled (unavoidable in our case due to multiple essential 3rd party dependencies that do not yet support it) and a watchOS 2 app.
I have filed a radar and cross-filed it to OpenRadar: https://openradar.appspot.com/radar?id=5974652266479616

As I can't find the bug fired in Apple (search "bitcode"). So I report the bug base on https://openradar.appspot.com/22066229 and you can find the bug by search title: "Cannot archive parent iPhone app with Bitcode disabled" in http://bugreport.apple.com

I just confirmed this is still broken in Xcode 7 Beta 5.

I filed a Radar and cross-posted to Open Radar. https://openradar.appspot.com/radar?id=4637507245309952

If you care about getting this resolved, duplicate it and submit at https://bugreport.apple.com/

With Xcode 7 Beta 5, now I can archive the app without getting "Not Code Signed" issue.
But after uploading the app to App Store, I got a mail saying:

Dear developer,

We have discovered one or more issues with your recent delivery for "[App Name]". To process your delivery, the following issues must be corrected:

Invalid Executable - The executable '[MyApp].app/Watch/[MyApp].app/PlugIns/[MyApp] Extension.appex/[MyApp] Extension' does not contain bitcode.


My build options:

Parent app Enable Bitcode: No

Watch app Enable Bitcode: Yes

This has been driving me crazy as well. I've examined and reexamined certifictes and profiles over and over. Thanks for posting that it's related to bitcode. I was able to confirm that bitcode is required for both the iOS app and the watchOS app by (Xcode 7 beta 5)

  1. create a new project with iOS Target and a watch Target
  2. leave the default ENABLE_BITCODE=YES on both projects
  3. successfully archive the build (no errors or warnings)
  4. set ENABLE_BITCODE=NO on the iOS project and receive the following 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: Not Code Signed

Parent App Signing Certificate: iPhone Developer: Rob Wright


Opening a radar also.

> The problem is you can't disable Bitcode for WatchOS 2. If you enable Bitcode for WatchOS, your Archive build will fail because your parent app doesn't use Bitcode even though the parent app does not require Bitcode.


This bug is still present in Xcode 7 beta 5 for me. Unable to build due to bitcode issues with 3rd party frameworks & watchOS2.