Xcode 6.2 watchkit 示例应用程序无法启动。“操作无法完成。(LaunchServicesError 错误 0。)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29097067/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:50:12  来源:igfitidea点击:

Xcode 6.2 watchkit sample app doesn't start. "The operation couldn’t be completed. (LaunchServicesError error 0.)

xcodesimulatorsamplewatchkit

提问by Takashi Shioya

The watchkit sample app didn't start.

watchkit 示例应用程序未启动。

The message was "The operation couldn't be completed. (LaunchServicesError error 0.)".

消息是“无法完成操作。(LaunchServicesError 错误 0。)”。

The sample app is "WatchKitCatalogUsingWatchKitInterfaceElements", which I got from the Apple Developer library.

示例应用程序是“WatchKitCatalogUsingWatchKitInterfaceElements”,它是我从 Apple Developer 库中获取的。

I tried to reset the contents and settings of the iOS simulator.
Any ideas would be greatly appreciated.

我试图重置 iOS 模拟器的内容和设置。
任何想法将不胜感激。

回答by AlbertX

The bundle identifier of your watch extension and app have to be related to your iOS apps original bundle identifier. If you have "com.yourCompany.yourApp" as bundle identifier your extension has to be "com.yourCompany.yourApp.watchkitextension" and the watch app "com.yourCompany.yourApp.watchkitapp" Otherwise you get this confusing error.

您的手表扩展程序和应用程序的捆绑标识符必须与您的 iOS 应用程序原始捆绑标识符相关。如果你有“com.yourCompany.yourApp”作为包标识符,你的扩展必须是“com.yourCompany.yourApp.watchkitextension”和手表应用“com.yourCompany.yourApp.watchkitapp”,否则你会得到这个令人困惑的错误。

回答by Jeremy Huddleston Sequoia

This can be caused by a number of problems. Please see the answer in the question this should be duped to:

这可能是由许多问题引起的。请参阅问题中的答案,这应该被欺骗:

An error was encountered while running (Domain = LaunchServicesError, Code = 0)

运行时遇到错误(域 = LaunchServicesError,代码 = 0)