[WC] WCSession counterpart app not installed BUT IT IS!

Right, this is getting on my nerves now. iOS app installed on iPhone via Xcode. Watch app installed on Watch via Xcode. Both apps are running and are in the foreground.

iOS app launches on iPhone and reports:

  • WCSession.isSupported = YES
  • theDelegate.session.isPaired = YES
  • theDelegate.session.watchAppInstalled = NO
  • theDelegate.session.activationState = Activated

I press a button in the Watch app. It reports:

  • session == activated and reachable

iOS app delegate receives a message from the Watch app:

didReceiveMessage (from Watch): message = {
    action = giveMeUpdatedItems;
}

The apps must be installed on the devices in order for the Watch app to have used sendMessage (which is only available if the session is reachable, which it is).

iOS app delegate passes that through as a notification to another bit of code that collates the info and sends it back to the Watch app.

watchNotificationUpdateData; userInfo = {
    action = giveMeUpdatedItems;
}

That bit of code in the iOS app checks whether we can send data to the Watch app, and doesn't send the data because:

  • WCSession.isSupported = YES
  • theDelegate.session.isPaired = YES
  • theDelegate.session.watchAppInstalled = NO
  • theDelegate.session.activationState = Activated

If I remove the check for watchAppInstalled, I get this:

Error sending Watch application context: Watch app is not installed.
{
    NSLocalizedDescription = "Watch app is not installed.";
    NSLocalizedRecoverySuggestion = "Install the Watch app.";
}

I've deleted and reinstalled the app on both devices countless times. I've rebooted the devices, plus the Mac. I've reinstalled Xcode. I've cleaned builds. I've deleted DerivedData. And still it says the companion app isn't installed.

Answered by darkpaw in 725611022

Well, it works now and I changed nothing; I just went to bed, and it works fine this morning.

It is an immeasurable amount of fun writing code for Apple devices...

Accepted Answer

Well, it works now and I changed nothing; I just went to bed, and it works fine this morning.

It is an immeasurable amount of fun writing code for Apple devices...

This is happening to me too, I was hoping this post would help me out. I've been suffering from this for several days, so not resolving for me.

One thing I'm curious about, are you using a Watch App + Extension (old style) or just a Watch App?

Apple's example code is still using the old style and works perfectly. For me, the watch can send messages to the phone, but the reply never comes back to the watch.

I'm using an Objective-C iOS app and a SwiftUI watchOS app.

I really don't know how to fix it; it just worked for me after leaving it alone for a few hours (i.e. going to sleep).

You might have two copies of the app installed on the Watch - or, at least, the Watch app on your iPhone thinks there are. Uninstall any of the installed Watch app, reboot both the iPhone and Watch, and see if you can then install a fresh copy to the Watch. I had to do this recently because I'd moved my targets around and it kind of fell out of sync.

I added a Watch app to an existing iOS app using XCode 14.1. (single target template) When using WCSession delegate, so I can message between the apps, I always get isWatchAppInstalled = false. If I create the same scenario using XCode 13.x, I have no issues.

Has anyone been able to add a watch app to an existing iOS app, create a WCSession object and have isWatchAppInstalled = true?

print("Session:activationDidCompleteWith --> IsPaired[(String(describing: session.isPaired))] isWatchAppInstalled[(String(describing: session.isWatchAppInstalled))] isReachable[(String(describing: session.isReachable))]");

displays:

Session:activationDidCompleteWith --> IsPaired[true] isWatchAppInstalled[false] isReachable[false]

re: previous post. I am using iOS and Watch simulators to test, not the actual devices.

Using:

  1. XCode 14.1 (single target watch app with existing iOS App)
  2. iPhone XS Simulator with IOS 13, paired w/Watch Series 5 (44mm) Simulator , Watch OS 7, 8 or 9

I also get back:

IsPaired[true] isWatchAppInstalled[false] isReachable[false]

No issues with iOS 14, 15 or 16 Simulators, i.e.,

IsPaired[true] isWatchAppInstalled[true] isReachable[true]

It's only iOS 13.

I also went back to XCode 13.x, with two watch targets, and have the exact same issue. The above is preventing me from using method channel communications between iOS app and Watch app under iOS 13.

note: re: previous post. My tests were done erasing simulator Content and Settings, deleting Derived data and clean builds to iPhone and Watch Sms's each time.

delete watch app targetrecreate a watch app. This is importmake sure name is never usedmake sure organization identifier is the main app'smake sure team is he main app's

click finish Maybe it works.

I had the same issue. It turned out you need to manually set "WatchKit Companion App Bundle Identifier" in the BuildSettings to the bundle identifier of the other app. So the value of that parameter in the settings for the iPhone app needs to be the bundle identifier of the Watch app and vice versa.

Then restart XCode and Simulator to make it work.

I hade all kinds of strange errors until I fixed that.

[WC] WCSession counterpart app not installed BUT IT IS!
 
 
Q