Swinject: Crash: Container.swift line 242 Container.resolve(entry:invoker:)

I am getting the following errors. Let me know what am I doing wrong:-

0  libswiftCore.dylib             0x107020d38 specialized _assertionFailure(_:_:file:line:flags:) + 164
1  libswiftCore.dylib             0x106eb808c default argument 1 of precondition(_:_:file:line:) + 38
2  Swinject                       0x106c73d20 Container.resolve<A, B>(entry:invoker:) (Container.swift:242)
3  Swinject                       0x106c72384 Container._resolve<A, B>(name:option:invoker:) (Container.swift:192)
4  Swinject                       0x106c74718 Container.resolve<A>(_:name:) (Container.swift:280)
5  Swinject                       0x106c747d8 protocol witness for Resolver.resolve<A>(_:) in conformance Container (Container.swift)
6  ABC                        0x100fddb94 specialized ReminderClient.unscheduleAllExpiredNotifications() -> Promise<Bool> (ReminderClient.swift:151)
7  ABC                        0x100fcf940 specialized AppDelegate.applicationDidBecomeActive(UIApplication) -> () (ReminderClient.swift:21)
8  ABC                        0x100fc00a8 @objc AppDelegate.applicationDidBecomeActive(UIApplication) -> () (AppDelegate.swift)
9  UIKitCore                      0x227ae6a84 -[UIApplication _stopDeactivatingForReason:] + 1256
10 UIKitCore                      0x2273932a0 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 476
11 UIKitCore                      0x227394100 _performActionsWithDelayForTransitionContext + 112
12 UIKitCore                      0x227393058 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
13 UIKitCore                      0x227397d9c -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
14 UIKitCore                      0x2276d9118 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 468
15 FrontBoardServices             0x1fd71c5a0 __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke.359 + 228
16 libdispatch.dylib              0x1fa724484 _dispatch_client_callout + 16
17 libdispatch.dylib              0x1fa6c7e58 _dispatch_block_invoke_direct$VARIANT$mp + 224
18 FrontBoardServices             0x1fd75a640 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
19 FrontBoardServices             0x1fd75a2cc -[FBSSerialQueue _performNext] + 416
20 FrontBoardServices             0x1fd75a8e8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
21 CoreFoundation                 0x1fac7a5b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
22 CoreFoundation                 0x1fac7a538 __CFRunLoopDoSource0 + 88
23 CoreFoundation                 0x1fac79e1c __CFRunLoopDoSources0 + 176
24 CoreFoundation                 0x1fac74ce8 __CFRunLoopRun + 1040
25 CoreFoundation                 0x1fac745b8 CFRunLoopRunSpecific + 436
26 GraphicsServices               0x1fcee8584 GSEventRunModal + 100
27 UIKitCore                      0x227af0bc8 UIApplicationMain + 212
28 ABC                        0x100ef1c54 main (AppDelegate.swift:69)
29 libdyld.dylib                  0x1fa734b94 start + 4

@jakubvano Please help.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

This looks OK. However, you need to use synchronised resolver for all resolve calls - even those which are on the main thread - otherwise there is no lock from main thread, that the resolver from other thread could interact with.