WatchKit Extension bundle identifiers

后端 未结 4 472
日久生厌
日久生厌 2020-12-04 07:56

I am trying to build my app but it failed. I am shown the message below.

error: WatchKit Extension doesn\'t contain any WatchKit apps whose bundle ide

4条回答
  •  爱一瞬间的悲伤
    2020-12-04 08:13

    First, let me highlight the excellent answer on this page by @DejanSkledar, as all of the locations noted in the answer are important.

    That said, the precise setup in that answer was not sufficient for me. I'd like to supplement this answer and point out that since watchkit 2, there appears to be a hierarchy required as you work from the app, to the watch app, and then finally to the app extension in terms of the bundle id's.

    Here are the settings in each of their corresponding info.plist files that worked for me after I found edwardmp's answer on a related issue.

    iPhone App's Bundle Id: com.domain.yourapp

    Watch App's Bundle Id: com.domain.yourapp.watchkit

    Watchkit's Extension Bundle Id: com.domain.yourapp.watchkit.extension

    As you can see, an iPhone app has a watchkit app, which itself happens to have a watchkit extension, and each of these levels must be reflected in each of their respective bundle id's.

    Completing the relationships, the watch app must point to the iPhone app to which it belongs using it's (WKCompanionAppBundleIdentifier), and the watch extension must point to the watch app to which it belongs (WKAppBundleIdentifier.)

    Watch App's WKCompanionAppBundleIdentifier: com.domain.yourapp

    Watch App's Extension WKAppBundleIdentifier: com.domain.yourapp.watchkit

    Hopefully this saves someone some time, as I had to struggle on this for a few hours :(

提交回复
热议问题