NFC iOS 13 读写故障

Posted

技术标签:

【中文标题】NFC iOS 13 读写故障【英文标题】:NFC iOS 13 read/write trouble 【发布时间】:2019-06-28 11:49:20 【问题描述】:

我阅读了有关 CoreNFC 的所有文档,观看了 WWDC 2019 中有关读写标签的所有视频,但我没有找到任何关于我的问题的信息。 我需要用一些数据写标签,以便在办公室打开门/窗。我使用读取的 NFC 标签在 swift 上创建了一个简单的项目,但是当我将手机放在 USB 阅读器上时,我的日志中出现了下一个问题:

2019-06-28 13:45:10.994351+0300 officeProj[872:62700] [xpc.exceptions] <NSXPCConnection: 0x283cec120> connection to service on pid 90 named com.apple.nfcd.service.corenfc: Exception caught during decoding of received selector didDetectExternalReaderWithNotification:, dropping incoming message.
Exception: Exception while decoding argument 0 (#2 of invocation):
Exception: decodeObjectForKey: class "NFFieldNotification" not loaded or does not exist
(
    0   CoreFoundation                      0x00000001a324aa04 2D4D4E9A-884C-31FE-90BE-B324E7B02A3F + 1223172
    1   libobjc.A.dylib                     0x00000001a37574fc objc_exception_throw + 56
    2   Foundation                          0x00000001a2f806dc 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2324188
    3   Foundation                          0x00000001a2d5d6f4 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 83700
    4   Foundation                          0x00000001a2fa2410 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2462736
    5   Foundation                          0x00000001a2db22b8 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 430776
    6   Foundation                          0x00000001a2db2624 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 431652
    7   Foundation                          0x00000001a2d9cc20 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 343072
    8   Foundation                          0x00000001a2f7e580 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2315648
    9   libxpc.dylib                        0x00000001a378e63c AC3BE951-8497-3F21-8844-8319F2577646 + 50748
    10  libxpc.dylib                        0x00000001a378e9b4 AC3BE951-8497-3F21-8844-8319F2577646 + 51636
    11  libdispatch.dylib                   0x00000001011d6d10 _dispatch_client_callout4 + 16
    12  libdispatch.dylib                   0x00000001011f0b1c _dispatch_mach_msg_invoke + 420
    13  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    14  libdispatch.dylib                   0x00000001011f196c _dispatch_mach_invoke + 520
    15  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    16  libdispatch.dylib                   0x00000001011de7a0 _dispatch_lane_invoke + 508
    17  libdispatch.dylib                   0x00000001011e9b74 _dispatch_workloop_worker_thread + 1364
    18  libsystem_pthread.dylib             0x00000001a3a97f5c _pthread_wqthread + 304
    19  libsystem_pthread.dylib             0x00000001a3a9aaa0 start_wqthread + 8
)
(
    0   CoreFoundation                      0x00000001a324aa04 2D4D4E9A-884C-31FE-90BE-B324E7B02A3F + 1223172
    1   libobjc.A.dylib                     0x00000001a37574fc objc_exception_throw + 56
    2   Foundation                          0x00000001a2fa2658 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2463320
    3   Foundation                          0x00000001a2db22b8 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 430776
    4   Foundation                          0x00000001a2db2624 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 431652
    5   Foundation                          0x00000001a2d9cc20 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 343072
    6   Foundation                          0x00000001a2f7e580 6511D0A1-2D67-36FA-BA0E-8FB08A6380FE + 2315648
    7   libxpc.dylib                        0x00000001a378e63c AC3BE951-8497-3F21-8844-8319F2577646 + 50748
    8   libxpc.dylib                        0x00000001a378e9b4 AC3BE951-8497-3F21-8844-8319F2577646 + 51636
    9   libdispatch.dylib                   0x00000001011d6d10 _dispatch_client_callout4 + 16
    10  libdispatch.dylib                   0x00000001011f0b1c _dispatch_mach_msg_invoke + 420
    11  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    12  libdispatch.dylib                   0x00000001011f196c _dispatch_mach_invoke + 520
    13  libdispatch.dylib                   0x00000001011dda10 _dispatch_lane_serial_drain + 304
    14  libdispatch.dylib                   0x00000001011de7a0 _dispatch_lane_invoke + 508
    15  libdispatch.dylib                   0x00000001011e9b74 _dispatch_workloop_worker_thread + 1364
    16  libsystem_pthread.dylib             0x00000001a3a97f5c _pthread_wqthread + 304
    17  libsystem_pthread.dylib             0x00000001a3a9aaa0 start_wqthread + 8
)

我试图找到一些关于 decodeObjectForKey: class "NFFieldNotification" 但在谷歌页面上没有任何信息。也许有人可以帮助我?或者,ios 13 beta 2 或 xCode 11 beta 2 只是这么原始的产品?假设这个问题对未来有帮助......

【问题讨论】:

这里有一些有用的信息github.com/underwindfall/NFCandroid/issues/1。 我知道,我已经阅读了这篇文章,但没有一个解决方案 感谢您的留言,我会在正常发布后尝试) 有人有NFC同屏读写的解决方案吗? 仍然需要解决方案。 【参考方案1】:

我遇到了同样的问题并通过添加解决了它

CoreNFC.framework

xyz.xcodeproj -> 构建阶段 -> 将二进制文件与库链接

(xyz.xcodeproj 是我的项目根文件)

【讨论】:

以上是关于NFC iOS 13 读写故障的主要内容,如果未能解决你的问题,请参考以下文章

NFC读写器是啥

Redis相关故障解决方案

在 iOS 13 中读取 NFC 卡的 UID

在我的应用程序中读取 iOS 13 NFC 前台标签,同时读取 iOS 后台

iOS 13 和 Xcode 11 中的配置文件问题中缺少 NFC 标签协议

读写分离中间件 MaxScale 在 slave 有故障后如何处理?