algolia / voice-overlay-ios

🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI
https://alg.li/voice
MIT License
545 stars 62 forks source link

Getting NSInternalInconsistencyException on allow microphone #15

Closed IchordeDionysos closed 4 years ago

IchordeDionysos commented 5 years ago

Hi,

we are seeing some crashes which happen due to the voice overlay search showing permission view controllers.

Error: Fatal Exception: NSInternalInconsistencyException accessing _cachedSystemAnimationFence requires the main thread

I can't reproduce it on my simulator... It occurs on several iOS versions and devices. How could this be solved? Is there something happening not on the UI thread?

Stacktrace ``` Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x1b9d83758 __exceptionPreprocess 1 libobjc.A.dylib 0x1b8f8bd00 objc_exception_throw 2 CoreFoundation 0x1b9c99434 +[_CFXNotificationTokenRegistration keyCallbacks] 3 Foundation 0x1ba773754 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4 UIKitCore 0x1e6c5ad98 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] 5 UIKitCore 0x1e6c5adc8 -[UIApplication _systemAnimationFenceCreatingIfNecessary:] 6 UIKitCore 0x1e6ca88c0 +[UIWindow _synchronizedDrawingFence] 7 UIKitCore 0x1e7196fa0 +[_UIKeyboardChangedInformation informationForKeyboardUp:withIAV:] 8 UIKitCore 0x1e6afb558 -[_UIRemoteKeyboards prepareToMoveKeyboard:withIAV:showing:forScreen:] 9 UIKitCore 0x1e6ae4360 -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] 10 UIKitCore 0x1e6ae6120 -[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] 11 UIKitCore 0x1e66aaca4 -[UIViewController _restoreInputViewsForPresentation] 12 UIKitCore 0x1e65bf1f4 -[UIPresentationController runTransitionForCurrentState] 13 UIKitCore 0x1e65bd1d4 -[UIPresentationController _dismissWithAnimationController:interactionController:target:didEndSelector:] 14 UIKitCore 0x1e66aa7a0 -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:] 15 UIKitCore 0x1e66aa3ec -[UIViewController _dismissViewControllerWithTransition:from:completion:] 16 UIKitCore 0x1e66a9bb8 -[UIViewController dismissViewControllerWithTransition:completion:] 17 UIKitCore 0x1e66a9974 -[UIViewController dismissViewControllerWithTransition:completion:] 18 UIKitCore 0x1e66a9178 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] 19 UIKitCore 0x1e66abf58 -[UIViewController dismissViewControllerAnimated:completion:] 20 InstantSearchVoiceOverlay 0x10342d26c UIViewController.dismissMe(animated:completion:) (Extensions.swift:24) 21 InstantSearchVoiceOverlay 0x103430628 partial apply for closure #1 in closure #1 in PermissionViewController.allowMicrophoneTapped() (PermissionViewController.swift:54) 22 InstantSearchVoiceOverlay 0x10342f15c thunk for @escaping @callee_guaranteed (@unowned Bool) -> () () 23 AVFAudio 0x1bfca5a40 __42-[AVAudioSession requestRecordPermission:]_block_invoke 24 AudioToolbox 0x1bde79020 invocation function for block in AudioSessionRequestRecordPermission_Common(void (unsigned char) block_pointer) 25 TCC 0x1bcb4b964 __TCCAccessRequest_block_invoke.75 26 TCC 0x1bcb4fb78 __tccd_send_message_block_invoke 27 libxpc.dylib 0x1b99d5e38 _xpc_connection_reply_callout 28 libxpc.dylib 0x1b99c902c _xpc_connection_call_reply_async 29 libdispatch.dylib 0x1b979597c _dispatch_client_callout3 30 libdispatch.dylib 0x1b97ad83c _dispatch_mach_msg_async_reply_invoke 31 libdispatch.dylib 0x1b97a5684 _dispatch_kevent_worker_thread 32 libsystem_pthread.dylib 0x1b998fac0 _pthread_wqthread 33 libsystem_pthread.dylib 0x1b9995dc4 start_wqthread ```
marcelfagadariu commented 5 years ago

Hey, @IchordeDionysos did you manage to solve it? I'm facing the same issue on my 6s and XR. Crashing on permissions.

IchordeDionysos commented 5 years ago

Unfortunately, not ...

bryanhoganjordan commented 4 years ago

Having same problem here - specifically seems to be:

"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'"

spinach commented 4 years ago

Should be related to #22

You can run pod update to get version 1.1.0, it should work.