Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

ios - WatchKit Extension bundle identifiers

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 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.

I have recently changed "com.domain.appname.watchkitapp" to "com.domain.differentappname.watchkitapp".

I cannot find where to change this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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):

iPhone Application Info.plist:

Set any bundle identifier as you like (the "Bundle identifier" property).

Example:

Bundle identifier: com.fruitcompany.orange

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

You also need to change the WKCompanionAppBundleIdentifier which must match with the iPhone application bundle identifier, like this:

WKCompanionAppBundleIdentifier: com.fruitcompany.orange

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

You also need to set the WKAppBundleIdentifier under the NSExtension attribute.

WKAppBundleIdentifier

The WKAppBundleIdentifier identifier must match with the WatchKit app bundle identifier like this:

WKAppBundleIdentifier: com.fruitcompany.orange.watchkit

Don't forget to check that your Bundle ID in project target is the same as in Info.plist!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...