I have an account that I use to do all my App Store builds. My apps main bundle id is registered in this account. I also have an app group setup for this bundle id. I have all the provisioning profiles and certificates and it works fine.
I have another account - an enterprise account that I use to distribute my app internally in my company. The bundle id for this app has an extra component (.ent) suffixed to the bundle id to distinguish it from the main app (even though most of the code is the same). This app also has an app group setup in this account with an extra component (.ent) added to the end of the app group id. The provisioning profile and certificates are all setup correctly for this too.
This setup worked fine for me until Xcode 8. I had different entitlements indicating the bundle id, group etc and I chose the provisioning profile for the enterprise build separately (for the same target) by creating a different scheme and assigning it there. All this worked fine upto Xcode 7. When I upgraded to Xcode 8 I tried to switch to "Automatically manage signing" but that did not help because there are 2 teams involved - one for the app store build and one for the enterprise build. Xcode couldn't figure that out. I switched to manually setting each provisioning profile but for the Enterprise scheme signing, Xcode now gives me this error : "Provisioning Profile (enterprise profile) doesn't support the group (main app group).
I have also set the "Development Team" setting in the "Build Settings" tab separately for app store and enterprise. I have also set the "Code Signing Entitlements" in the build settings separately for the 2 builds. I have also set the "Info.plist file" in "Build Settings" separately. Inspite of all this Xcode 8 still doesn't figure out that the app group is different and gives me this build error and eventually fails to sign the enterprise build.