Failed to install app error: Invalid Bundle - No Apple Watch Binary

假装没事ソ 提交于 2019-11-27 16:17:34

问题


I'm trying to develop an extension of my app for the Apple Watch.

Instead of install the app on the watch, I have this error:

AppName Failed to install AppName, error: Invalid Bundle - No Apple Watch Binary

In my info.plist files...

For the extension, I have:

<key>CFBundleIdentifier</key>
    <string>com.mycompany.AppName.watchkitextension</string>
<key>WKAppBundleIdentifier</key>
    <string>com.mycompany.AppName.watchkitapp</string>

For the WatchKit app, I have:

<key>CFBundleIdentifier</key
    <string>com.mycompany.AppName.watchkitapp</string>
<key>WKCompanionAppBundleIdentifier</key>
    <string>com.mycompany.AppName</string>

And for my app, I have:

<key>CFBundleIdentifier</key>
    <string>com.mycompany.AppName</string>

Did I miss something?


回答1:


Try explicitly setting the "Executable file" in the WatchKit app's info.plist.

I had changed the name of my executable file and had the same issue.




回答2:


This error plagued me for about 7 hours then I restarted my watch out of desperation and the error went away.




回答3:


I was plagued with this error for hours. For me, the problem was that my WatchKit Extension's Deployment Target was set to an iOS version higher than my phone's. I simply changed it to match my device's version and it worked perfectly.




回答4:


For me the problem was fixed by adding the watch app to my iOS target's Embed Watch Content section.

I'm using Xcode 7 and watchOS 2.0. It was building fine on the device, but the simulator was giving me this error.

Steps:

  1. Find your iOS target
  2. Click Build Phases
  3. Ensure your watch app (.app) is included in "Target Dependencies" and "Embed Watch Content"



回答5:


In my case, none of these solutions worked for me, however I noticed that by default, my WatchKit App required iOS 8.3, and my phone was running iOS 8.2. Updating the OS to 8.3 solved my problem. It may seem like an obvious solution, but I thought I would share for anyone who could share my problem.




回答6:


In my case, I got it when building app for WatchOS2. I fixed by setting the schemes like this:

The Watch Extension Scheme builds 3 Target: iPhone (2 dependencies) + Extension (no dependencies) + Watch App

Running Extension Scheme on iPhone simulator -> works!



回答7:


In my case it was an Info.plist configuration error. The Bundle identifier was different to the NSExtension -> NSExtensionAttributes -> WKAppBundleIdentifier.

Setting the same value fixed the error.




回答8:


Resets of watch/xcode/iphone doesn't help sometimes, as it described in other answer.

One more case to solve this: This error appears, when I change iPhone language of my iPhone to not English (in my case - Russian) language. When I set back English - everything start works as usual!




回答9:


Make sure:

  • The bundle id of iOS app is prefix of watch app & extension' bundle id.
  • Value of WKCompanionAppBundleIdentifier in Info.plist of your watch app matches bundle id of your iOS app.
  • iOS app, watch app & extension should signed by the same cert.
  • There must be a build phase in iOS app target:
    • Destination: Products Directory
    • Subpath: $(CONTENTS_FOLDER_PATH)/Watch
    • Click +, add your watch app target.



回答10:


Filling in the Bundle Display name in the info.plist.Default is blank,there will be an alert.(Xcode 7.3)



来源:https://stackoverflow.com/questions/29972534/failed-to-install-app-error-invalid-bundle-no-apple-watch-binary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!