I have stumbled upon a most annoying problem. I have an app with a today widget. The app uses one distribution profile and the widget target is using another. All is well. I can archive the app in Xcode and install it on my device.
However, when trying to install the IPA that has been created by my Xcode server bot, it won't work. I get the error: "Installation failed"
Before adding the widget target to the project, everything worked fine.
The Xcode server has the same certificate and provisioning profiles installed.
I've scanned the build logs and found nothing out of the ordinary. Everything is signed correctly and it logs ** ARCHIVE SUCCEEDED **
Any ideas?
UPDATE
Seems like it doesn't work without the widget either. When trying to install the IPA that my build server built I get the error:
**App installation failed**
The application could not be verified.
I've tried on a new device that I haven't installed the app on before.
UPDATE 2
here is the log when trying to install the IPA from Xcode:
Feb 23 14:52:46 iPhone kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Feb 23 14:52:46 iPhone lockdownd[67] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Feb 23 14:52:47 iPhone kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Feb 23 14:52:47 iPhone lockdownd[67] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Feb 23 14:52:47 iPhone mobile_installation_proxy[271] <Warning>: LaunchServices: Please include the kCFBundleIdentifierKey in the options dictionary when installing an app.
Feb 23 14:52:47 iPhone mobile_installation_proxy[271] <Warning>: LaunchServices: installing app with unknown bundleID
Feb 23 14:52:47 iPhone installd[44] <Notice>: 0x10050c000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/[XXXXXX].ipa" type Customer requested by mobile_installation_proxy (pid 271)
Feb 23 14:52:47 iPhone installd[44] <Notice>: 0x10050c000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.XXX.XXXXXX; Version=140407, ShortVersion=1.0>
Feb 23 14:52:47 iPhone profiled[121] <Notice>: (Note ) MC: Provisioning profiles changed
Feb 23 14:52:47 iPhone installd[44] <Error>: SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Feb 23 14:52:47 iPhone kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Feb 23 14:52:47 iPhone lockdownd[67] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Feb 23 14:52:47 iPhone profiled[121] <Notice>: (Note ) MC: Provisioning profiles changed
Feb 23 14:52:47 iPhone securityd[82] <Error>: CFReadStream domain: 12 error: 8
Feb 23 14:52:47 iPhone installd[44] <Error>: SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Feb 23 14:52:48 iPhone securityd[82] <Error>: CFReadStream domain: 12 error: 8
Feb 23 14:52:48 iPhone installd[44] <Error>: 0x10050c000 -[MIInstallableBundle performVerificationWithError:]: 473: Application is missing the application-identifier entitlement.
Feb 23 14:52:48 iPhone installd[44] <Error>: 0x10050c000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Feb 23 14:52:48 iPhone mobile_installation_proxy[271] <Error>: 0x10040c000 __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error Domain=MIInstallerErrorDomain Code=63 "Application is missing the application-identifier entitlement." UserInfo=0x127d3b040 {LegacyErrorString=ApplicationVerificationFailed, FunctionName=-[MIInstallableBundle performVerificationWithError:], SourceFileLine=473, NSLocalizedDescription=Application is missing the application-identifier entitlement.}
Feb 23 14:52:48 iPhone mobile_installation_proxy[271] <Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Feb 23 14:52:48 iPhone mobile_installation_proxy[271] <Error>: 0x10051c000 handle_install: Installation failed: Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x127d43dc0 {Error=ApplicationVerificationFailed, ErrorDescription=Application is missing the application-identifier entitlement.}
Feb 23 14:52:48 iPhone kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Feb 23 14:52:48 iPhone lockdownd[67] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Feb 23 14:52:48 iPhone kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Feb 23 14:52:48 iPhone lockdownd[67] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Update 3
It seems to be the entitlements.plist that's causing the issues. The entitlements files has been generated because I'm using shared data between the targets (main target and the widget). When removing the widget target and the entitlements files it all builds correctly.
New question, how can I build the app, using bots, with shared data and entitlements.plist files? Similar to this answer