target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphoneos' platform - watchos-2

I already have a Watch app written for iOS 8.2, I want to configure a Watch app for watch OS 2 and deliver both versions of mine Watch app inside the same iOS app. So I create a new Watch App Target for WatchOS2 with Xcode7.0, but it can not work.
How to do?
Thanks!

Make sure in build settings > under Base SDK > this is set to latest watchOS.

When you make a watch target, you need to go to Build Settings for both the Watch and the Watch Extension and change Architectures/Supported Platforms from 'iOS' to 'watchOS'.

The WatchOs2 extension should be running on the Watch Tracy, so switch it to be running on Watch in the Build Settings.

Related

Not able to install apple watch app

I created an application for Apple watch Model MJ3T2B/A using health kit. It is with watch OS version 2.0. I used Xcode version 7.3.1 to create the app and installed it in my iPhone using diawi. I am not able to run it directly since it said deployment version of watch app is 2.2 and the one i am using is 2.0.
When i enable Show App in Apple Watch it is automatically getting disabled after some time in iPhone(iOS 9.3.2) watch application. Do i need to use different xcode version to create my app? I am not getting any OS updates also in my iPhone app. It says watch OS 2.0 and software is upto date.
I got what was the issue. It is the deployment target which keeps me from installing the watch app. I changed the deployment target to 2.0 in Project->Build settings and now i am able to install the application
For me it helped to check "Window" > "Devices and Simulators". For the iPhone to which the relevant Apple Watch is paired, the name of the Apple Watch was shown as <null>. After unpairing the iPhone (right click > "Unpair Device") and pairing it again, the issues was gone.
Afterwards I was able to select the WatchKit App in the Schemes list and select the entry for "My iPhone + My Apple Watch" in the Device list and Run/Debug the app.
It has also sadly shown that the issue re-appears multiple times during the day and I have to repeat these steps.
I had to add ClockKit.framework as an Optional library under the watch app Extension "Link Binary With Library" Build Phases because I was using the WatchOS 5.0 function called CLKFullColorImageProvider which was causing the app to crash. But, before I did this, I set the deployment target to match that of the Watch OS (4.3 in my case) so the app would run from XCode and dump out the error. So, it seems that changing the deployment target is a good way to get the app to install in order to debug other problems.
I found this answer here: https://forums.developer.apple.com/thread/108598
I had a similar issue where the Apple Watch app would fail to install my Development Apple Watch App. I was able to finally get it installed by increasing the Bundle Number the iOS App and the WatchKit App.

Which target do I build for App Store submission including Watch extension?

I have a universal iOS app which runs on all iOS 9 capable iPhone and iPads. The app also has a Watch extension. When I come to submit the first version to the App Store, which target do I build, archive and submit? Do I have to archive the Watch extension target, or will the Watch extension be included if I build, archive and submit the iOS app target? Or does it not matter?
Apple documentation states the following:
Adding a Watch app target to your Xcode project creates two new
executables and updates your project’s build dependencies.
Furthermore, regarding building of the app:
Building your iOS app builds all three executables (the iOS app,
Watch app, and WatchKit extension) and packages them together inside
the iOS app’s bundle.
(emphasis mine)
The iOS app target. Extension and watch app would be bundled within the original package, automatically.

ios watchkit app not able to install into iwatch using Xcode 7.2

I'm new to working with Apple watch. I'm trying to install the hello world watchkit app into iwatch OS Version(1.0) that has been paired with my iPhone5c OSversion(9.1). When I try to choose the Build target device from the list of devices in Xcode it clearly shows that "Unavailable device" target. Below is the error message.
I did mouse over on the The OS version installed on watch apple watch doesn’t support Watchkit Extention products. Please see the below image for your reference. I would like to know what is the exact issue here and how can I fix it by steps and attach the device with Xcode 7.2 to run.
The answer is that the OS on your Apple Watch is lower than it'll support for testing, they changed some of the API in Watch OS v2. If you update to OS v2 you should be able to use it for development.

Enable Disable Watch Target in iPhone app setting Xcode

Recently I have developed the watch app for my iPhone app and added the watch target in iPhone app.
I want to know is there any kind of setting by which I can choose to add/hide(enable/disable) watch target in iPhone app, like in current market release I don't want to include the watch app, so is there any setting by which I can make it disable in iPhone build but code exist in app.
Is there any kind of target/info plist or build settings by which I can achieve this.
Please suggest.
Any help would be highly appreciated.
Thanks in advance.
Go to your application target, Build Phases, Target Dependencies, and remove the WatchKit Extension from the list.
Check your Build Phases,Copy Bundle Resources in your Target,copy the watchkit app.There need no inclue watchkit app.

Apple Watch app installation issue - NSExtensionPointIdentifier

I'm trying to install an app with WatchKit App and WatchKit Extension onto an iOS8.1 phone, from Xcode 6.2.
I have the Deployment Target set at 8.1
and the Base SDK at 8.2.
I get this error:
This app contains an app extension that specifies an extension
point identifier that is not supported on this version of iOS
for the value of the NSExtensionPointIdentifier key in its Info.plist
I've seen some similar questions but not found a solution that works. Is there a way to programmatically handle the lower iOS version?
To answer this (using #LoVo's comment) - I fixed the issue by changing the deployment target to 8.2 in the Extension's Build Settings (not in the main app's build settings).
The main app's deployment target can be set at a lower deployment target, mine is now 7.0.

Resources