WatchKit 扩展包标识符
我正在尝试构建我的应用程序,但它失败了.我看到下面的消息.
I am trying to build my app but it failed. I am shown the message below.
错误:WatchKit 扩展不包含任何捆绑标识符匹配com.domain.appname.watchkitapp"的 WatchKit 应用.验证 WatchKit 扩展的 Info.plist 中 WKAppBundleIdentifier 的值是否与 WatchKit 应用的 Info.plist 中的 CFBundleIdentifier 值匹配.
error: WatchKit Extension doesn't contain any WatchKit apps whose bundle identifiers match "com.domain.appname.watchkitapp". Verify that the value of WKAppBundleIdentifier in your WatchKit Extension's Info.plist matches the value of CFBundleIdentifier in your WatchKit App's Info.plist.
我最近将 "com.domain.appname.watchkitapp"
更改为 "com.domain.differentappname.watchkitapp"
.
I have recently changed "com.domain.appname.watchkitapp"
to "com.domain.differentappname.watchkitapp"
.
我找不到在哪里更改此设置.
I cannot find where to change this.
更改包标识符时必须小心,这里是它们的设置方式(您需要更改 Info.plist 中的每个标识符以用于 iPhone 应用,用于 Watchkit 扩展程序 和 Watchkit 应用):
You have to be careful when changing the bundle identifiers, and here's how they should be set (you need to change each identifier in the Info.plist for the iPhone app, for the Watchkit Extension and for the Watchkit App):
根据需要设置任何捆绑标识符(捆绑标识符"属性).
Set any bundle identifier as you like (the "Bundle identifier" property).
示例:
Bundle identifier: com.fruitcompany.orange
WatchKit 应用信息.plist
此处的包标识符必须以 iPhone 应用程序的标识符为前缀,像这样(示例):
WatchKit App Info.plist
The bundle identifier here must be prefixed with the identifier of the iPhone application, like this(example):
Bundle identifier: com.fruitcompany.orange.watchkit
您还需要更改 WKCompanionAppBundleIdentifier
,它必须与 iPhone 应用程序包标识符匹配,如下所示:
You also need to change the WKCompanionAppBundleIdentifier
which must match with the iPhone application bundle identifier, like this:
WKCompanionAppBundleIdentifier: com.fruitcompany.orange
WatchKit 扩展信息.plist:
此处的包标识符必须以 iPhone 应用程序的标识符为前缀,像这样(示例):
WatchKit Extension Info.plist:
The bundle identifier here must be prefixed with the identifier of the iPhone application, like this(example):
Bundle identifier: com.fruitcompany.orange.watchkit.extension
您还需要在 NSExtension
属性下设置 WKAppBundleIdentifier
.
You also need to set the WKAppBundleIdentifier
under the NSExtension
attribute.
WKAppBundleIdentifier
标识符必须与 WatchKit 应用程序包标识符匹配,如下所示:
The WKAppBundleIdentifier
identifier must match with the WatchKit app bundle identifier like this:
WKAppBundleIdentifier: com.fruitcompany.orange.watchkit
不要忘记检查项目目标中的 Bundle ID 是否与 Info.plist 中的 相同!
Don't forget to check that your Bundle ID in project target is the same as in Info.plist!