FBSOpenApplicationErrorDomain Code=3

2019-01-18 08:27发布

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 !

5条回答
ら.Afraid
2楼-- · 2019-01-18 08:42

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

查看更多
Lonely孤独者°
3楼-- · 2019-01-18 08:49

Keep Your Settings


Restart simulator:

  • Click on Simulator app
  • Simulator > Quit Simulator or CMD + Q
  • Click on xcode
  • Project > Run or CMD + R
查看更多
老娘就宠你
4楼-- · 2019-01-18 08:50

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

查看更多
三岁会撩人
5楼-- · 2019-01-18 08:59

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.

查看更多
SAY GOODBYE
6楼-- · 2019-01-18 09:04

iOS Simulator -> Reset Contents and Settings...

Worked for me

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

查看更多
登录 后发表回答