Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS TextField, Speech to text crashes on device #2984

Closed
dima-avdeev-jb opened this issue Apr 5, 2023 · 4 comments · Fixed by JetBrains/compose-multiplatform-core#770
Closed
Assignees
Labels
accessibility bug Something isn't working ios

Comments

@dima-avdeev-jb
Copy link
Contributor

dima-avdeev-jb commented Apr 5, 2023

Speech-to-text with microphone crashes

2023-04-05 19:30:44.256980+0300 My application[52510:3386435] [UIKBFeedbackGenerator] <_UIKBFeedbackGenerator: 0x28029f480>: Couldn't update haptics muting for dictation audio recording. No engine.
2023-04-05 19:30:44.528885+0300 My application[52510:3386230] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 553]. Layer: <CALayer:0x282681d40; position = CGPoint (0 0); bounds = CGRect (0 0; 164 48); delegate = <_UIEditMenuListView: 0x14d107390; frame = (-82 -24; 164 48); alpha = 0; layer = <CALayer: 0x282681d40>>; sublayers = (<CALayer: 0x2826839e0>); opaque = YES; opacity = 0; shadowOpacity = 0.25; shadowOffset = CGSize (0 3); shadowRadius = 12>'
microphone-crash.MP4
@dima-avdeev-jb dima-avdeev-jb added bug Something isn't working submitted labels Apr 5, 2023
@dima-avdeev-jb dima-avdeev-jb self-assigned this Apr 5, 2023
@dima-avdeev-jb dima-avdeev-jb changed the title iOS TextField bugs iOS TextField Speech to text crashes on device Apr 5, 2023
@dima-avdeev-jb dima-avdeev-jb changed the title iOS TextField Speech to text crashes on device iOS TextField, Speech to text crashes on device Jun 19, 2023
@mazunin-v-jb mazunin-v-jb self-assigned this Aug 1, 2023
@mazunin-v-jb
Copy link
Contributor

mazunin-v-jb commented Aug 2, 2023

Well, I've checked the example in compose-multiplatform-core and Image Viewer from compose-multiplatform, both latest versions.
On several platforms:

  • iPhone 13, 16.5.1
  • iPhone 14, 16.5
  • iPad Pro, 16.5.1
  • iPhone Simulator, 16.5
  • iPhone Simulator, 15.4
  • iPhone Simulator, 14.5

And I couldn't reproduce the issue on these devices.

However, in the Image Viewer app I was getting the following warning message:

[EditMenuInteraction] The edit menu (configuration: <UIEditMenuConfiguration: 0x283846580: identifier=0477C4FB-79F1-4CC4-AB58-42BA9D330453, sourcePoint={inf, inf}, arrowDirection=.automatic>) has an invalid target rect ({{inf, inf}, {nan, nan}}); ignoring present.

Seems like it might be related to the given error message in the first message. I've tried to look up "UIEditMenu" on both projects and I couldn't find anything.
I assume that the problem has been fixed since April (and not by us), but I can't find any information where and how.

@etolstoy
Copy link
Contributor

etolstoy commented Aug 9, 2023

Tested on three devices with 1.5.0-Beta:

  • iPad Pro, iPadOS 16.1.1. Works fine.
  • iPhone SE, iOS 14.7.1. Works fine.
  • iPhone 12, iOS 16.0.3. Crashes.

The only difference I see is where the button is situated. Crash happens when the button isn't a part of the keyboard.

2023-08-09 20 38 39
2023-08-09 20 38 33

@mazunin-v-jb
Copy link
Contributor

mazunin-v-jb commented Aug 15, 2023

Status update:
We with @dima-avdeev-jb have found the reason.
Somehow, the context menu with speech-to-text options appears with undefined area. We manually set the rect for that menu, so on the video with reproducing the issue it appears in the top-left corner of the screen. (see attached, this is iOS 16.0)

Without that manual setting, in iOS 16.0 it leads to crash, but in the other versions it just sends a warning to the console that I mentioned before.

It seems like that random appearing of a speech-to-text menu is wrong behavior, so I'll fix that.

Speech.to.text.problem.mp4

@jxdom
Copy link

jxdom commented Mar 11, 2024

I also encountered the same problem. When I use voice input, the iOS app crashes. I'm using iOS 17.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility bug Something isn't working ios
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants