iOS App Crash [UIKeyboardTaskQueue waitUntilAllTasksAreFinished] only on simulator
12:57 29 May 2018

We are facing an unknown crash when trying our login :

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.'

The crash only happens with simulators, when you are entering the text fields information with your keyboard. When using "Toggle software Keyboard", everything is going fine...

We checked every topic but couldn't find an answer.

Thanks in advance if you have any idea.

PS : here is the full log

2018-05-29 17:50:22.769863+0200 Katch[89138:772858] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] may only be called from the main thread.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010972612b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x0000000108321f41 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010972b2f2 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x0000000107dc2d69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
    4   UIKit                               0x000000010bc7005d -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] + 380
    5   UIKit                               0x000000010b1dfd98 -[UIKeyboardImpl setDelegate:force:] + 1596
    6   UIKit                               0x000000010b6cebcf -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 1271
    7   UIKit                               0x000000010b6d8480 -[UIPeripheralHost(UIKitInternal) _preserveInputViewsWithId:animated:reset:] + 498
    8   UIKit                               0x000000010b098130 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1233
    9   UIKit                               0x000000010b099e94 -[UIViewController _presentViewController:withAnimationController:completion:] + 4621
    10  UIKit                               0x000000010b09c9a9 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 99
    11  UIKit                               0x000000010b09d079 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 532
    12  UIKit                               0x000000010b09c908 -[UIViewController _presentViewController:animated:completion:] + 181
    13  UIKit                               0x000000010b09cc67 -[UIViewController presentViewController:animated:completion:] + 159
    14  UIKit                               0x000000010b0a1fea -[UIViewController _showViewController:withAction:sender:] + 274
    15  UIKit                               0x000000010b0a204e -[UIViewController showViewController:sender:] + 57
    16  UIKit                               0x000000010b0d0f2c -[UINavigationController showViewController:sender:] + 215
    17  UIKit                               0x000000010b0a1f4e -[UIViewController _showViewController:withAction:sender:] + 118
    18  UIKit                               0x000000010b0a204e -[UIViewController showViewController:sender:] + 57
    19  Katch                               0x00000001068ae882 _T05Katch29SignUpUserInfosViewControllerC6signInyyFySb_SStcfU_Tf4ngXg_n + 530
    20  Katch                               0x00000001068af157 _T05Katch29SignUpUserInfosViewControllerC04signC0yyFySb_SStcfU_TATm + 71
    21  Katch                               0x00000001068af100 _T05Katch29SignUpUserInfosViewControllerC6signInyyFySb_SStcfU_TA + 16
    22  Katch                               0x00000001068ecc46 _T05Katch12KMSignUpDataC6signInySS4mail_SS8passwordySb_SStc10completiontFyyXlSg_SSSgtcfU_Tf4gdg_n + 2006
    23  Katch                               0x00000001068edb31 _T05Katch12KMSignUpDataC04signC0yySb_SStc10completion_tFyyXlSg_SSSgtcfU_TATm + 65
    24  Katch                               0x00000001068edae0 _T05Katch12KMSignUpDataC6signInySS4mail_SS8passwordySb_SStc10completiontFyyXlSg_SSSgtcfU_TA + 16
    25  Katch                               0x000000010688be27
_T05Katch16KMServiceManagerC7request9Alamofire11DataRequestCAC0B4TypeO3for_s10DictionaryVySSypGSg10parametersALyS2SGSg7headersyyXlSg_SSSgtc10completiontFyAE0F8ResponseVyypGcfU_ + 4743
    26  Katch                               0x000000010688ceeb _T05Katch16KMServiceManagerC7request9Alamofire11DataRequestCAC0B4TypeO3for_s10DictionaryVySSypGSg10parametersALyS2SGSg7headersyyXlSg_SSSgtc10completiontFyAE0F8ResponseVyypGcfU_TA + 59
    27  Alamofire                           0x0000000106f93b3e _T09Alamofire11DataRequestC8responseACXDSo13DispatchQueueCSg5queue_x0D10SerializeryAA0B8ResponseVy16SerializedObjectQzGc17completionHandlertAA0biH8ProtocolRzlFyycfU_yycfU_AA0biH0VyypG_Tg5 + 334
    28  Alamofire                           0x0000000106f9e1ee _T09Alamofire15DownloadRequestC8responseACXDSo13DispatchQueueCSg5queue_x0D10SerializeryAA0B8ResponseVy16SerializedObjectQzGc17completionHandlertAA0biH8ProtocolRzlFyycfU_yycfU_AA0biH0VyypG_Tg5TATm + 62
    29  Alamofire                           0x0000000106f9ddf0 _T09Alamofire11DataRequestC8responseACXDSo13DispatchQueueCSg5queue_x0D10SerializeryAA0B8ResponseVy16SerializedObjectQzGc17completionHandlertAA0biH8ProtocolRzlFyycfU_yycfU_AA0biH0VyypG_Tg5TA + 16
    30  Alamofire                           0x0000000106f722f0 _T0Ix_IyB_TR + 32
    31  libdispatch.dylib                   0x000000010dccb2f7 _dispatch_call_block_and_release + 12
    32  libdispatch.dylib                   0x000000010dccc33d _dispatch_client_callout + 8
    33  libdispatch.dylib                   0x000000010dcd2754 _dispatch_continuation_pop + 967
    34  libdispatch.dylib                   0x000000010dcd0b85 _dispatch_async_redirect_invoke + 780
    35  libdispatch.dylib                   0x000000010dcd8102 _dispatch_root_queue_drain + 772
    36  libdispatch.dylib                   0x000000010dcd7da0 _dispatch_worker_thread3 + 132
    37  libsystem_pthread.dylib             0x000000010e2645a2 _pthread_wqthread + 1299
    38  libsystem_pthread.dylib             0x000000010e26407d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
ios xcode