I read all documentation about CoreNFC, saw all videos about read and write tags from WWDC 2019 but i didn't find no one information about my problem.
I need to write tag with some data for open door/window at office. I create simple project on swift with read NFC tags but when i hold my phone to USB reader i have the next trouble in my log:
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
)
I tried to find something about decodeObjectForKey: class "NFFieldNotification" but realy no one info on google pages. Maybe someone can help me? Or maybe iOS 13 beta 2 or xCode 11 beta 2 just so raw product? Suppose this question will be helpful on future...
I had the same problem and solved it by adding
CoreNFC.framework
in
xyz.xcodeproj -> Build Phases -> Link Binary With Libraries
(xyz.xcodeproj is my Project Root File)
In my case the problem has been solved by adding missing Capability "Near Field Communication Tag Reading"
Related
We have been trying to run our app to prepare for iOS 16 but so far no luck. The app runs perfectly in Xcode 13. Also when we download the app from App Store to iOS 16 beta device, it works with no problem.
What we face with new Xcode 14 Beta 5 is the app runs till the first view controller then we get a weird error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application circumvented Objective-C runtime dealloc initiation for <UINavigationController> object.'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff800427380 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff80004dbaf objc_exception_throw + 48
2 Foundation 0x00007ff800b876ac _userInfoForFileAndLine + 0
3 UIKitCore 0x0000000124447d4e -[UIViewController dealloc] + 1475
4 UIKitCore 0x0000000124359e30 -[UINavigationController dealloc] + 389
5 libobjc.A.dylib 0x00007ff80004b6a1 _ZN11objc_object17sidetable_releaseEbb + 203
6 libobjc.A.dylib 0x00007ff80004be64 _ZN19AutoreleasePoolPage12releaseUntilEPP11objc_object + 180
7 libobjc.A.dylib 0x00007ff80004bcad objc_autoreleasePoolPop + 203
8 UIKitCore 0x00000001252e54bf -[_UIAfterCACommitBlock run] + 80
9 UIKitCore 0x00000001252e59a4 -[_UIAfterCACommitQueue flush] + 190
10 UIKitCore 0x0000000124d40730 _runAfterCACommitDeferredBlocks + 782
11 UIKitCore 0x0000000124d2eede _cleanUpAfterCAFlushAndRunDeferredBlocks + 96
12 UIKitCore 0x0000000124d64abb _afterCACommitHandler + 72
13 CoreFoundation 0x00007ff800386015 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
14 CoreFoundation 0x00007ff800380982 __CFRunLoopDoObservers + 515
15 CoreFoundation 0x00007ff800380ecd __CFRunLoopRun + 1161
16 CoreFoundation 0x00007ff800380667 CFRunLoopRunSpecific + 560
17 GraphicsServices 0x00007ff809bfc28a GSEventRunModal + 139
18 UIKitCore 0x0000000124d30621 -[UIApplication _run] + 994
19 UIKitCore 0x0000000124d354fd UIApplicationMain + 123
20 xxxxxx 0x000000010e9aa830 main + 96
21 dyld 0x00000001136e52bf start_sim + 10
22 ??? 0x00000001148c751e 0x0 + 4639716638
)
OK, So I fixed my own problem. For me it was the code in the dependency file I was using in my pods. So, simply search for
+ (void)initialize {
}
which is most possibly causing the error.
When I'm trying to run apple watch standalone app on physical device its throwing this error:
Error:
Details
Unable to install "TinyRage WatchKit App"
Domain: com.apple.dtdevicekit
Code: -402620394
--
The executable was signed with invalid entitlements.
Domain: com.apple.dtdevicekit
Code: -402620394
Failure Reason: The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x000000011e6e16e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x000000011e6e1de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x000000011e72156a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
3 DVTFoundation 0x0000000103851156 DVTInvokeWithStrongOwnership + 73
4 DTDeviceKitBase 0x000000011e721301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
5 IDEiOSSupportCore 0x000000011e5baa25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
6 DVTFoundation 0x00000001039823ba __DVT_CALLING_CLIENT_BLOCK__ + 7
7 DVTFoundation 0x0000000103983a92 __DVTDispatchAsync_block_invoke + 809
8 libdispatch.dylib 0x00007fff7306d5f8 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00007fff7306e63d _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff730748e0 _dispatch_lane_serial_drain + 602
11 libdispatch.dylib 0x00007fff73075396 _dispatch_lane_invoke + 385
12 libdispatch.dylib 0x00007fff7307d6ed _dispatch_workloop_worker_thread + 598
13 libsystem_pthread.dylib 0x00007fff732ae611 _pthread_wqthread + 421
14 libsystem_pthread.dylib 0x00007fff732ae3fd start_wqthread + 13
);
}
--
However with another app everything works correctly without any issues.
Can anyone tell me what is this crash about since there's no stack trace and cannot be symbolicated?
I'll paste here only the relevant part of the crash. My project is written in Swift.
NO_CRASH_STACK + 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000102445424
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [18568]
Triggered by Thread: 7
Thread 7 name: Dispatch queue: NSOperationQueue 0x282ced140 (QOS: UNSPECIFIED)
Thread 7 Crashed:
0 ------------ 0x0000000102445424 0x102304000 + 1315876
1 ------------ 0x0000000102444a9c 0x102304000 + 1313436
2 ------------ 0x000000010232e408 0x102304000 + 173064
3 ------------ 0x000000010232b320 0x102304000 + 160544
4 CFNetwork 0x0000000208b5b228 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 32
5 CFNetwork 0x0000000208b6f9c8 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 176
6 Foundation 0x000000020900e82c __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
7 Foundation 0x0000000208f16a28 -[NSBlockOperation main] + 72
8 Foundation 0x0000000208f15efc -[__NSOperationInternal _start:] + 740
9 Foundation 0x0000000209010700 __NSOQSchedule_f + 272
10 libdispatch.dylib 0x0000000207fb96c8 _dispatch_call_block_and_release + 24
11 libdispatch.dylib 0x0000000207fba484 _dispatch_client_callout + 16
12 libdispatch.dylib 0x0000000207f5d83c _dispatch_continuation_pop$VARIANT$mp + 412
13 libdispatch.dylib 0x0000000207f5cf04 _dispatch_async_redirect_invoke + 600
14 libdispatch.dylib 0x0000000207f69a28 _dispatch_root_queue_drain + 376
15 libdispatch.dylib 0x0000000207f6a2d0 _dispatch_worker_thread2 + 128
16 libsystem_pthread.dylib 0x000000020819c17c _pthread_wqthread + 472
17 libsystem_pthread.dylib 0x000000020819ecec start_wqthread + 4
I solved the problem myself just by downloading the dSYM files from App Store Connect and Xcode automatically symbolicated the crash.
I installed my app into an iPhone via Xcode, then disconnect the iPhone from Mac, lauch the app ... crash.
Re-connect the iPhone to Mac, open Xcode > Devices > The iPhone > View Device Logs, but got the following result, it cannot symbolicate the crash in my code.
I also tried using the symbolicatecrash command, got the same result.
Last Exception Backtrace:
0 CoreFoundation 0x1c623b38 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x1b8ab062 objc_exception_throw + 34
2 CoreFoundation 0x1c623a80 +[NSException raise:format:] + 104
3 我的AppName 0x00091410 0x89000 + 33808
4 我的AppName 0x000d897a 0x89000 + 326010
5 我的AppName 0x000d849a 0x89000 + 324762
6 我的AppName 0x0009fb0c 0x89000 + 92940
7 我的AppName 0x000dc9f6 0x89000 + 342518
8 libdispatch.dylib 0x1bcf1792 _dispatch_call_block_and_release + 6
9 libdispatch.dylib 0x1bcf177e _dispatch_client_callout + 18
10 libdispatch.dylib 0x1bcf5d00 _dispatch_main_queue_callback_4CF + 898
11 CoreFoundation 0x1c5dfd64 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
12 CoreFoundation 0x1c5dde14 __CFRunLoopRun + 844
13 CoreFoundation 0x1c5310ea CFRunLoopRunSpecific + 466
14 CoreFoundation 0x1c530f0c CFRunLoopRunInMode + 100
15 GraphicsServices 0x1dcdbb3c GSEventRunModal + 76
16 UIKit 0x218b5e7e UIApplicationMain + 146
17 我的AppName 0x000bfe56 0x89000 + 224854
18 libdyld.dylib 0x1bd1e4e6 _dyld_process_info_notify_release + 26
My build-settings:
Deployment Postproccessing NO
Strip Debug Symbols During Copy NO
Strip Linked Product YES
Strip Style All Symbols
Debug Information Format DWARF with dSYM File
Debug Information Level Compiler default
Symbols Hidden by Default NO
Finally, I find out the reason: the PRODUCT_NAME includes Chinese charactors ....
my app crashes on iPad when I open a new view even though in the simulator it works like a charm.
Any help is strongly appreciated!
Thanks in advance
Console Output:
2012-07-18 10:32:19.783 Coverdale[3484:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 4 beyond bounds [0 .. 3]'
First throw call stack:
(0x3757688f 0x315eb259 0x374bf9db 0x37745 0x35c3f 0x306e3c8b 0x30708481 0x306ccbd5 0x3078f359 0x306d53b5 0x306d53d1 0x306d5263 0x3078f31f 0x307446cb 0x3074400f 0x3078dc05 0x3078c367 0x307e76a7 0x2c4fb 0x3075c93d 0x307d6627 0x33093933 0x3754aa33 0x3754a699 0x3754926f 0x374cc4a5 0x374cc36d 0x376c5439 0x306d8cd5 0x22103 0x220a8)
terminate called throwing an exception(lldb)
Crash Report
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3757688f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x315eb259 objc_exception_throw + 33
2 CoreFoundation 0x374bf9db -[__NSArrayM objectAtIndex:] + 271
3 Coverdale 0x00092745 -[PreparationViewController setDetails:newFile:] (PreparationViewController.m:376)
4 Coverdale 0x00090c3f -[PreparationViewController viewDidLoad] (PreparationViewController.m:70)
5 UIKit 0x306e3c8b -[UIViewController view] + 167
6 UIKit 0x30708481 -[UIViewController nextResponder] + 21
7 UIKit 0x306ccbd5 -[UIResponder _containsResponder:] + 37
8 UIKit 0x3078f359 -[UINavigationController defaultFirstResponder] + 57
9 UIKit 0x306d53b5 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 25
10 UIKit 0x306d53d1 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 53
11 UIKit 0x306d5263 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 31
12 UIKit 0x3078f31f -[UIWindowController transitionViewDidStart:] + 83
13 UIKit 0x307446cb -[UITransitionView _didStartTransition] + 71
14 UIKit 0x3074400f -[UITransitionView transition:fromView:toView:] + 999
15 UIKit 0x3078dc05 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 4937
16 UIKit 0x3078c367 -[UIViewController presentViewController:withTransition:completion:] + 3123
17 UIKit 0x307e76a7 -[UIViewController presentModalViewController:animated:] + 31
18 Coverdale 0x000874fb -[IntroTableViewController tableView:didSelectRowAtIndexPath:] (IntroTableViewController.m:498)
19 UIKit 0x3075c93d -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 945
20 UIKit 0x307d6627 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 159
21 Foundation 0x33093933 __NSFireDelayedPerform + 415
22 CoreFoundation 0x3754aa33 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 15
23 CoreFoundation 0x3754a699 __CFRunLoopDoTimer + 365
24 CoreFoundation 0x3754926f __CFRunLoopRun + 1207
25 CoreFoundation 0x374cc4a5 CFRunLoopRunSpecific + 301
26 CoreFoundation 0x374cc36d CFRunLoopRunInMode + 105
27 GraphicsServices 0x376c5439 GSEventRunModal + 137
28 UIKit 0x306d8cd5 UIApplicationMain + 1081
29 Coverdale 0x0007d103 main (main.m:17)
30 Coverdale 0x0007d0a8 start + 40
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3291b32c __pthread_kill + 8
1 libsystem_c.dylib 0x34c90208 pthread_kill + 48
2 libsystem_c.dylib 0x34c89298 abort + 88
3 libc++abi.dylib 0x3229ef64 abort_message + 40
4 libc++abi.dylib 0x3229c346 _ZL17default_terminatev + 18
5 libobjc.A.dylib 0x315eb350 _objc_terminate + 140
6 libc++abi.dylib 0x3229c3be _ZL19safe_handler_callerPFvvE + 70
7 libc++abi.dylib 0x3229c44a std::terminate() + 14
8 libc++abi.dylib 0x3229d81e __cxa_rethrow + 82
9 libobjc.A.dylib 0x315eb2a2 objc_exception_rethrow + 6
10 CoreFoundation 0x374cc506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x374cc366 CFRunLoopRunInMode + 98
12 GraphicsServices 0x376c5432 GSEventRunModal + 130
13 UIKit 0x306d8cce UIApplicationMain + 1074
14 Coverdale 0x0007d0fc main (main.m:17)
15 Coverdale 0x0007d0a0 start + 32
I deleted the App on the iPad and run it again.
It looks like that an array generated from a text file which i am reading out with componentsSeparatedByString: had less entries than i was accessing.