Working with my first application for learning purposes. It goes well but has met into a problem with Xcode. When I try to run the application on the iPhone simulator this m
Just quite the simulator and start again works for me. In my case the error always occur if I change the bundle identifier and run afterwards the iPhone X simulator.
I encountered this error while developing my first WatchKit app. Followed guidance from @PureRushh, @Antonioni and others to dump the contents of:
~/Library/Logs/CoreSimulator/CoreSimulator.log
The log contents led me to the error. I'll include the details in case others encounter this error while developing WatchKit apps.
Log message:
com.apple.dt.Xcode[89555] : installApplication:withOptions:error:: Error Domain=IXUserPresentableErrorDomain Code=1 "This app could not be installed at this time." UserInfo={NSLocalizedDescription=This app could not be installed at this time.,NSUnderlyingError=0x7f9ab87d1f20 {Error Domain=MIInstallerErrorDomain Code=101 "WatchKit 2.0 app's bundle ID com.somecompany.AirTime2.watchkitapp is not prefixed by the parent app's bundle ID followed by a '.'; expected prefix com.somecompany.AirTime."
Cause: I had modified the value associated with the BundleIdentifier key in the Info.plist (via General-> Bundle Identifier) of the parent app to match a URL Type (for SSO redirect); however, I failed to update the WatchKit App Info.plist value associated with the WKCompanionAppBundleIdentifier key (see second bold line).
Fix: Modify the WatchKit App Info.plist value for the key WKCompanionAppBundleIdentifier to agree with parent app's bundle ID
Occurred to me when I switched branches with another developer who was using a different version of CocoaPods , Deleting derived data folder worked !
To add a bit of additional info here. While Xcode is completely unhelpful about telling you why the app couldn't be installed, the console has quite good error messages. Just launch Console.app (Applications > Utilities > Console) and filter the output by installcoordinationd
.
It'll give you something like this that describes the error:
installcoordinationd -[IXSCoordinatedAppInstall _onQueue_acquireAssertionAndDoInstall]_block_invoke: Installation for identifier:com.acme.location-thingy uuid:blah-blah-blah-foo intent:IXCoordinatorIntentInitiating creator/appDRI:InstallCoordination Simple SPI userInitiated:N state:IXAppCoordinationStateWaitingForInstall> failed: Error Domain=MIInstallerErrorDomain Code=99 "WatchKit v3 app has disallowed Info.plist key: NSLocationUsageDescription" UserInfo={LegacyErrorString=WatchKitAppIllegalInfoPlistKey, FunctionName=-[MIExecutableBundle hasOnlyAllowedWatchKitAppInfoPlistKeysForWatchKitVersion:error:], SourceFileLine=1841, NSLocalizedDescription=WatchKit v3 app has disallowed Info.plist key: NSLocationUsageDescription}
Hope this is helpful to someone!
I managed to find the problem. The problem was that I had added some keys to a property list file that was not valid. I found the error by looking in the log file that was located here: ~/Library/Logs/CoreSimulator/
Changing the CFBundleShortVersionString in InfoPlist.strings to match the one in info.plist fixed this for me. I had to use the simulator's "Erase All Content and Settings" after making this change.
Trying to launch on a simulator with iOS 9.0 (instead of 11.2) gave this error instead, which helped me to find more answers on what's apparently the same issue:
The operation couldn’t be completed. (LaunchServicesError error 0.)