While archiving an iOS app on Xcode during the compilation phase;
I get the error -
"error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit." even though I have confirmed that this is set correct.
Then, why is this happening?
Thanks
Check build settings in watchappextension target if you have correct watch extension Info.plist file path. In my case, i had watch plist set.
I had similar issue. To solve that, I've modified the extension identifier so that it has watchkit's identifier as prefix. This is because, unless identifiers are prefix, those won't be allowed to embed on Xcode settings.
Check list:
In main iOS app settings on general tab, add your watchkit app in the embedded binaries section. Note that, if you ever deleted build folder, the embedded watchkit app may not be displayed in this section even if you just added there.
Make sure you see the watchkit app both in target dependancy & embedded binaries section. If not, add them on the build phases tab of your iOS app.
Now on settings of watchkit app, add your extension in the embedded binaries.
You should see the watchkit extension both in target dependancy & embedded binaries section. If not, add them on the build phases tab of your watchkit app.
On build settings of the extension, make sure bitcode is enabled. Base sdk should be latest iOS sdk.
See the watchkit app identifier is a prefix of the extension. I've renamed the product module (both for watchkit app & extension) to avoid spaces.
You should now be able to build or archive with proper mobile provisions. By the way, my Xcode version is 9.3.
Exit XCode, remove derived data, start XCode again and clean project
Related
Worked on Xcode 10. Now in the beta I can't build I keep getting this error:
a "WatchKit" is not available when building for iOS Simulator.
Consider using #if !os(iOS) to conditionally import this framework.
I had the same issue for one swift file in the WatchKit Extension. It turned out that it was a member of both the iOS app and the WatchKit Extension. I unticked the iOS app in the target membership section for the file so that it only belongs to the WatchKit Extension target. Now the project builds successfully.
Some of the functionality to communicate between the Apple watch with the iPhone/iPad used to be implemented within the WatchKit framework. But at some point it got moved into the WatchKitConnectivity framework.
If you look in your Target's "Build Phase" -> "Link Binary With Libraries" section, you will see the "WatchKit.framework" with "Optional" status. iOS13+ has become more "strict" so it won't build unless I completely remove the "WatchKit.framework", and instead add "WatchConnectivity.framework".
Also make sure your iPhone/iPad code refers use "import WatchConnectivity" instead of "import WatchKit".
We need to use "Conditional Imports" to resolve the issue.
Replace the import WatchKit header with the below code :
#if !os(iOS)
import WatchKit
#endif
This resolved my issue and build successfully in iOS 13.
Xcode 11 removes WatchKit from the iOS SDK. From release notes:
The WatchKit framework is no longer included in the iOS SDK. If you’re using WatchKit APIs from iOS, you need to remove this use. The WatchKit framework remains available on watchOS. If you’re using WatchKit APIs from iOS to infer availability of features on the paired Apple Watch, include information about your use case when you submit feedback to Feedback Assistant. (49707950)
This includes Cordova plugins that reference WatchKit in plugin.xml:
<framework src="WatchKit.framework" />
The above line will add WatchKit as a framework for the iOS app target. You'll need to remove this and add WatchKit only to Watch target of your app.
Ive made an iPhone app and started playing around with a watch kit app with it in the same project. However, I only want to upload the iPhone app now not the watch kit app. How do I only upload the watch kit app? I have this problem Embedded binary is not signed with the same certificate as the parent app: but I don't want to upload my watch kit app. Help
Removing watchOS Target
You should just remove the Watch Extension.
Solution:
Go to Build Phases in iOS target, which is located in your Project file, then from Target Dependencies, remove WatchKit Extension target.
Also in the same page, you should go to Embed App Extensions and remove the WatchKit extension.
Then, clean, build and run your project as usual. You should be done.
Re-adding watchOS Target
The only step is to add the extension to Target Dependencies.
NOTE: However, if you are working with watchOS 1, after adding the extension to Target Dependencies, you should add it to the Embed App Extensions too. Just select the *.appex file containing WatchKit extension data there.
Conclusion
1- To remove watchOS Target, remove it from both Target Dependencies and Embed App Extensions.
2- To re-add watchOS Target,
A) In watchOS 2, add it to Target Dependencies.
B) In watchOS 1, also add the *.appex file to Embed App Extensions as well as adding the extension to Target Dependencies.
We've got an Xcode project with build configurations for the Apple Watch as well. Our Apple Watch app isn't ready yet, so we'd like to release with it disabled. What's the best way to disable Apple Watch functionality in a build?
Remove the WatchKit extension
To make sure that your WatchKit extension is no longer visible, you have to do two things:
1) Remove the WatchKit extension from "Target Dependencies"
(To go to Target Dependencies: in the project navigator, click the project file. Then click the target of the iPhone app. Go to the Build Phases tab.)
2) Remove the WatchKit extension from "Embed App Extensions" (in Xcode 7+, "Embed Watch Content")
(In Build Phases, go to Embed App Extensions. Remove the WatchKit extension entry from the list Embed App Extensions.)
Finally, you may have to clean your build folder. Then build and run your iPhone application.
To re-add the WatchKit extension:
For watchOS1: FIRST, add your WatchKit extension to Target Dependencies. This re-creates the .appex file that you can now add to the list under Embed App Extensions by pressing the plus button and choosing "App Name WatchKit Extension.appex".
For watchOS2: Just add your WatchKit extension to Target Dependencies.
Remarks:
I have tried the whole process of removing and recreating the extension both in the simulator and on the actual devices (iPhone and Apple Watch). It worked in both cases.
I have also tried to do either A or B but that was not sufficient.
I used Xcode version 6.3.2
The above answer is correct but if you are not able to figure out the first point.
1) Remove the WatchKit extension from "Target Dependencies".
It means to go to your target, select build phases, then click Dependencies. remove watch dependency
NOTE
Even better way is to just search 'watch' keyword in Main Target -> Build phases. The dependencies and embed watch content will be listed. Just remove them
I have a watchkit target in my project. The problem I am facing is I don't need the watchkit target to be uploaded right now. I still want to keep the code however and don't want to delete all the files. Is there a way I can submit the App without the watch kit extension App? I thought about deleting the targets (not the files), but I don't know what is the best course of action in this situation. Can I tell itunesconnect not to include the watchkit App?
If you go to the target of your main app and remove the watchkit extension from "Embedded Binaries" it should remove your watchkit app.
To expand upon the answer from Tiago, remove the Watchkit Extension from "Embedded Binaries" and "Target Dependencies."
See Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode.
I have an iOS application with several targets, which runs in a really different way on each of them. I added a watchkit app to it, but haven't found a way to specify which target of my app should be the parent. Have any of you found a way? Or is it something to ask Apple about?
You can definitely do this. You can set the target when you create the WatchKit App. Here are the steps:
Set up all your targets in your project (I believe you have this completed)
Select the + under targets and create a new WatchKit App
The next options page let's you pick from a bunch of options to set up the WatchKit App target
Under Embed in Application, choose the target you want to embed the WatchKit App in
I just confirmed this on Xcode 6.2 Beta 5.