Xcode: “This app could not be installed at this ti

2019-01-18 01:23发布

问题:

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 message always pops up "This app could not be installed at this time."

What is wrong? There are no errors when trying to build the app. Has tried to clean the build. Reinstall pods. Restarted Xcode. Erased all settings on the simulator device, however, the problems still exist.

The error message does not give me any information. Is there another logfile I could look into or something?

回答1:

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/



回答2:

Reset the simulator:

Hardware -> Erase All content and settings...

Clean your project:

shift+cmd+K

shift+opt+cmd+K

This should fix your issue



回答3:

I know the question has been answered but for others encountering the same issue I suggest following:

  • Check simulator logs, if its printing something useful. First, selecte simulator then from menu option open Debug -> Open System Logs.

  • Make sure only 1 simulator is running.

  • Delete the older version of app from the simulator.

  • If you importing a custom framework, make sure custom framework->bundle-id is not same as currentAppProject->bundle-id. If you are not sure then simply change the bundle-id of current project.

  • Also some of the simulators can be buggy -> Simply change the simulator, it may resolve the issue, for me changing the simulator worked.



回答4:

I resolved this issue to remove DerivedData from Xcode Preferences. and also Restart the simulator from Hardware.



回答5:

Found issue in ~/Library/Logs/CoreSimulator//MobileInstallation

WatchKit 2 app extension's NSExtension.NSExtensionAttributes.WKAppBundleIdentifier value does not match WatchKit app's bundle ID



回答6:

For anybody wasting time on this obscure error. If you don't have any relevant logs and all the other answers fail, you might check if you recently added a framework that for some reason (didn't investigated why) can't be embedded, only linked. Happened to me with GoogleMaps for iOS.



回答7:

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.)



回答8:

Just restart simulator to fix it in my case.



回答9:

rm -rf ~/Library/Developer/Xcode/DerivedData/


回答10:

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.



回答11:

I was seeing this on all simulators and all devices. Uninstalling the app would work once, but it continued to fail on me.

The fix was to wipe out all my project's pods:

pod deintegrate

And then re-install again:

pod install

This was with XCode 9.3 and iOS 11.2/11.3.



回答12:

I encountered this error, but it had nothing to do with my Info.plist or Cocoapods. I had mistakenly deleted a duplicate NotificationServiceExtension group in my Xcode project, which caused me to end up with a NotificationServiceExtension target that had no source files (I only need one source file to integrate/piggy-back off of the Urban Airship SDK's rich notifications).

After reverting the commit where I deleted the duplicate group and then deleting the correct duplicate group (the one that didn't list the source file as being part of the target), I was able to build and run just fine.



回答13:

Occurred to me when I switched branches with another developer who was using a different version of CocoaPods , Deleting derived data folder worked !



回答14:

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!



回答15:

You may also want to look under Capabilities for your different targets. I ended up having an issue with my App ID



回答16:

I got this error too. It all started a short time after I let Xcode update my project settings. Specifically on my CocoaPod sub-project. I removed the pods and reinstalled them and that solved my issue. Hope this works for you or others who find this question as well.



回答17:

If you importing a custom framework, make sure custom framework->bundle-id is not same as currentAppProject->bundle-id. If you are not sure then simply change the bundle-id of current project. It works for me : )



回答18:

In my case, the message appeared when I was migrating from Cocoapods to Carthage and having the Firebase iOS SDK among my dependencies.

The issue was resolved when I realized that Firebase does NOT need to be among the frameworks that are copied in the carthage copy-frameworks phase.

For more on Firebase and Carthage, see the official documentation.



回答19:

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

share|improve this answer
1

I have faced the same problem like this. but nothing worked for me. Then i noticed one problem in my info.Plist file. The Executable file name was different compare to Schema name in Edit Schema. So make sure This both is same, then try to run your project. It should work.

share|improve this answer
0

Instead of restarting the simulator you can also just delete the app from the simulator. This error is caused when you have made your app ready for production and then attempt to build it on a phone. There are issues when you are trying to build the same app twice (this is also why you don't get this issue when you run in testing mode).

share|improve this answer
0

This happened when I had an empty build number set for the target in Xcode 10.0.

share|improve this answer
0

In my case i was trying to run a widget. Scheme settings for widget should be: Run -> Info -> Executable: "Ask on launch"

share|improve this answer
0

Hi Guys just want to let you know that none of the above worked for me.

I was busy working, integrating a dynamic library into my project. I know that the library worked, so I didn't give it a second thought.W hat I did was just to delete the reference to MyLibrary1, recompiled MyLibrary1 and embedded again for a successful build. Hope this helps someone.

Regards Rolf

share|improve this answer
New contributor
Rolf Dubek is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
-1

I had this issue while working with Xcode 9.2. The solution is to simply delete the app and re-install it again.

share|improve this answer
  • Why down vote when this solution worked for me! – Jayprakash Dubey Mar 22 '18 at 4:23
  • Once the app is installed it will not allow me to reinstall - so this doesn't work for me. – Ethan Jun 4 '18 at 18:00
  • @Ethan : Why so? – Jayprakash Dubey Jun 5 '18 at 5:18
  • To be clear i didn’t down vote. But this didn’t work for me. What ended up working was resetting the device and cleaning the build and the project – Ethan Jun 5 '18 at 5:20

Your Answer

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged ios xcode ios11 xcode9.2 or ask your own question.

收藏的人(0)

Ta的文章 更多文章
登录 后发表评论
0条评论
还没有人评论过~