46

I just added a Watch app to my project and try :

override func awakeWithContext(context: AnyObject?) {
        super.awakeWithContext(context)
        let res =  WKInterfaceController.openParentApplication(["key" : "value"]) { (replyInfo, error) -> Void in
            print("replyInfo : \(replyInfo) + error \(error)")
        }
        print(res) // true here
    }

In my AppDelegate I wrote :

func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: ([NSObject : AnyObject]?) -> Void) {
        reply(["replyKey" : "replyValue"]);
    }

When I launch the Watch app I just have :

replyInfo : [:] + error Optional(Error Domain=FBSOpenApplicationErrorDomain Code=3 "The operation couldn’t be completed. (FBSOpenApplicationErrorDomain eor 3.)")

Screenshot for error message

Is it due to the simulator ? Do you know what am doing wrong ?

Thanks !

4
  • I have the same problem with xcode 7.0 beta 3. When i use xcode 6.3, it works well. I hope, it can help you.
    – ben_
    Commented Jul 21, 2015 at 8:21
  • Ok thx. I'll wait next beta and update this post
    – Pierre
    Commented Jul 21, 2015 at 15:04
  • 3
    I had this problem after installing xcode 7.1....xcode sucks, ios9 sucks..apple sucks..
    – Stas
    Commented Oct 27, 2015 at 12:49
  • If you have this problem on a physical device (as opposed to the simulator), see this question.
    – Senseful
    Commented Dec 20, 2015 at 18:08

6 Answers 6

97

iOS Simulator -> Reset Contents and Settings...

Worked for me

iOS Simulator -> Reset Contents and Settings... -> Reset

6
  • Didn't worked for me..I'm using Xcode 6.4 on OS X 10.11.1. I cannot migrate to Xcode 7.1 due to technical issues. Any other fix? Commented Nov 2, 2015 at 12:34
  • Same scenario ... Xcode 6.4, OS X 10.11.1, Xcode 7 with an internal bug in IB disabling me from using latest Xcode. After reverting back to Xcode 6.4, dozens of simulators appeared in it, so I wiped out all of them, and used Xcode to resurrect just iOS 7.1 ones. A now this.
    – lef
    Commented Nov 6, 2015 at 12:30
  • This solution didn't work for me. I have OS X 10.11.1. and both Xcode 6.4 / 7.1.1 with iOS 8.4, 9.0 and 9.1 simulator (running of MacBook Pro 2015) Commented Nov 10, 2015 at 12:56
  • 1
    Did as above except I quit the simulator and then quit Xcode, relaunched and ran without issue.
    – sully77
    Commented Nov 10, 2015 at 21:40
  • Killing the simulator and clearing the project (Shift+cmd+K ) and rerunning did the trick for me.
    – Despotovic
    Commented Nov 11, 2015 at 10:59
28

Keep Your Settings


Restart simulator:

  • Click on Simulator app
  • Simulator > Quit Simulator or CMD + Q
  • Click on xcode
  • Project > Run or CMD + R
6

For those using real hardware and not the simulator, I had this issue. The problem is I'd selected my individual developer account as my code signer. In doing so, I had to go to:

Settings > General > Profiles > Device Management > (my email)

and then tap the Trust (my email) to trust my individual account.

After I did this, cmd-R ran my code on my watch/phone just fine.

1
1

Try returning to the view controller and running again in the simulator; it worked for me in Xcode 7.2.

0
1

I was getting this when running on the actual watch. Turned out to be caused by the developer account not being trusted on the iPhone. Settings->Device Management->...

0

in react native just uninstall the pods and podfile.lock and reinstall the pods through command

cd ios && pod install

Not the answer you're looking for? Browse other questions tagged or ask your own question.