xcode WatchOS 2:“无法安装手表应用程序”“启动‘TestApp WatchKit 应用程序扩展’时出错”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31641162/
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
WatchOS 2: "Cannot Install Watch App" "Error Launching 'TestApp WatchKit App Extension'"
提问by Jay Hickey
I am getting a AlertView popup error on iOS every time I try to install a watchOS 2 app in Xcode 7 beta 4:
每次尝试在 Xcode 7 beta 4 中安装 watchOS 2 应用程序时,我都会在 iOS 上收到 AlertView 弹出错误:
Cannot Install Watch App
TestApp is installed on your iPhone, but the TestApp app for Apple Watch is currently unavailable.
无法安装手表应用
TestApp 已安装在您的 iPhone 上,但 Apple Watch 的 TestApp 应用程序当前不可用。
I've also tried installing the watchOS app through the Apple Watch iOS app, but I get the same error. And when I try to run the watchOS target, I get this:
我也尝试通过 Apple Watch iOS 应用程序安装 watchOS 应用程序,但我遇到了同样的错误。当我尝试运行 watchOS 目标时,我得到了这个:
Error Launching 'TestApp WatchKit App Extension'
Installation error. Check the iPhone console for more details."
启动“TestApp WatchKit App Extension”时出错
安装错误。检查 iPhone 控制台以获取更多详细信息。”
I checked the iPhone console and no additional details are there.
I've reinstalled Xcode, deleted and re-added all simulators, reset simulator content & settings...none of which has worked. I also created a completely new project. This is occurring in the simulator and on a physical device/watch running iOS 9 beta 4 and watchOS 2 beta 4.
我重新安装了 Xcode,删除并重新添加了所有模拟器,重置了模拟器内容和设置......这些都没有奏效。我还创建了一个全新的项目。这发生在模拟器和运行 iOS 9 beta 4 和 watchOS 2 beta 4 的物理设备/手表上。
Has anyone figured out a fix or workaround for this?
有没有人想出解决方法或解决方法?
Thanks!
谢谢!
回答by Jay Hickey
Looking through the device system logs, I found my issue:
查看设备系统日志,我发现了我的问题:
Jul 26 18:05:14 MacBook-Pro companionappd[22461]: (Error) WatchKit: validateWatchKitApplicationInfoDictionary, invalid Info.plist key 'NSAppTransportSecurity'
Jul 26 18:05:14 MacBook-Pro companionappd[22461]: (Error) WatchKit: validateWatchKitApplicationInfoDictionary, invalid Info.plist key 'NSAppTransportSecurity'
I had an App Transport Security key set on both the watchOS app info.plist
and the watchOS extension info.plist
. It should only be set on the extension.
我在 watchOS 应用程序info.plist
和 watchOS 扩展程序上都设置了一个应用程序传输安全密钥info.plist
。它应该只设置在扩展上。
回答by Vipendra Gupta
You should remove NSAllowsArbitraryLoadskey from info.plistof watch app. Watch Extension only allow NSAllowsArbitraryLoadskey to include. Because only extension is responsible for handling all these things not the watch app.
您应该从手表应用的info.plist中删除NSAllowsArbitraryLoads键。Watch Extension 只允许包含 NSAllowsArbitraryLoads键。因为只有扩展程序负责处理所有这些事情,而不是手表应用程序。
回答by RawMean
Cleaning the build (shift-command-K) fixed this problem for me.
清理构建(shift-command-K)为我解决了这个问题。
回答by ltgbau
You may need to delete the app in iPhone then launch again to solve this problem :)
您可能需要在 iPhone 中删除该应用程序,然后重新启动以解决此问题:)
回答by Jayprakash Dubey
I had this same issue. This happens due to issue while installing app on watchOS.
我有同样的问题。这是由于在 watchOS 上安装应用程序时出现的问题。
Below are some fix for this :
以下是对此的一些修复:
- Clean Xcode(try
cmd+shift+K
andcmd+shift+option+K
- Clean Build Folder).
- 清理 Xcode(尝试
cmd+shift+K
并cmd+shift+option+K
- 清理构建文件夹)。
Quit Xcodeand re-build your app.
Delete appand reinstall it.
退出 Xcode并重新构建您的应用程序。
删除应用程序并重新安装它。
Solution 1 worked in my case.
解决方案 1 在我的情况下有效。
回答by Shyam
Me too faced same issue.
我也面临同样的问题。
In my case the issue was because of the location access alert. Mine app was related to weather app.I was accessing user location,so whenever app is getting launched,iphone simulator have an alert ,asking the user to allow/disallow picking of his location.
在我的情况下,问题是由于位置访问警报。我的应用程序与天气应用程序有关。我正在访问用户位置,因此每当应用程序启动时,iPhone 模拟器都会发出警报,要求用户允许/禁止选择他的位置。
After giving location permission watch app simulator launched successfully.
授予位置权限后,手表应用程序模拟器成功启动。
Hope this might help someone.
希望这可以帮助某人。
回答by mishimay
In my case, the problem was solved with these process.
就我而言,问题已通过这些过程解决。
- Back version control (git) to the commit that doesn't have Apple Watch extension.
- Build & run iPhone app.
- Re-back to the latest commit and build & run.
- 将版本控制 (git) 返回到没有 Apple Watch 扩展的提交。
- 构建和运行 iPhone 应用程序。
- 重新回到最新的提交并构建和运行。