capawesome-team / capacitor-nfc

⚡️ Capacitor plugin for reading and writing NFC tags.
https://capawesome.io/plugins/nfc/
MIT License
73 stars 14 forks source link

bug: XPC Error: Error Domain=NSCocoaErrorDomain Code=4099 #31

Closed Syiana closed 1 year ago

Syiana commented 1 year ago

Plugin version: [0.3.2]

Platform(s): IOS

Hello,

since the last XCode update I get the following error message when I run: Nfc.isSupported();

45[NFCHardwareManager areFeaturesSupported:outError:]:166 XPC Error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nfcd.service.corenfc was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.nfcd.service.corenfc was invalidated: failed at lookup with error 159 - Sandbox restriction.}

I checked my Provisioning Profile and it contains NFC Tag Reading also my Privacy - NFC Scan Usage Description is filled in the PInfo file.

Any idea what the issue could be?

Thanks for your help!

Capacitor doctor:

[success] iOS looking great! 👌
robingenz commented 1 year ago

Thank you for your request. I will try to reproduce your issue.

robingenz commented 1 year ago

Does this error occur in the simulator or on a real device?

Syiana commented 1 year ago

Does this error occur in the simulator or on a real device?

Hello, thanks for your fast reply! It happens on a real device (Iphone 11pro and Iphone 15pro)

robingenz commented 1 year ago

I cannot reproduce the issue. I have updated both XCode and iOS to the latest version but still get no error:

⚡️  To Native ->  Nfc isSupported 44585250
⚡️  TO JS {"isSupported":true}

Can you reproduce this issue with the Capacitor NFC demo?

etikhonov commented 1 year ago

I faced the same issue. README first step was missed :facepalm:

Ensure Near Field Communication Tag Reading capabilities have been enabled in your application in Xcode. See Add a capability to a target for more information.

@Syiana Did You check it?

Syiana commented 1 year ago

@robingenz in the demo the plugin version 5.0.2 and 5.0.1 is working, so it has something to do with my app.

@etikhonov I can't find NFC in the "add capabilities" in Xcode, I got it just in my profile:

image

It worked before the new Mac OS and Xcode update, so it is a little bit strange for me.

Syiana commented 1 year ago

Okay I found it! I just pressed the wrong "+" button in XCode.. it is working now :)

Thanks for your help!