There is a problem when using From Messages with WKWebView.

Enter my mobile phone number on the web page and run the Send event.



Then, "From Messages" appears on the keyboard.



If press this and modify the text, App Crash will occur.



============= ERROR LOG ================


2019-11-27 10:53:46.698597+0900 cm-ios[8668:2911641] Can't find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 25683_PortraitTruffle_iPhone-Simple-Pad_Default

2019-11-27 10:53:46.721500+0900 cm-ios[8668:2911641] Can't find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 25683_PortraitTruffle_iPhone-Simple-Pad_Default

2019-11-27 10:53:46.745266+0900 cm-ios[8668:2911641] [LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don't want.

Try this:

(1) look at each constraint and try to figure out which you don't expect;

(2) find the code that added the unwanted constraint or constraints and fix it.

(

"<NSLayoutConstraint:0x283f28230 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x11b022990.bottom == _UIKBCompatInputView:0x11b05b050.top (active)>",

"<NSLayoutConstraint:0x283f02800 'assistantHeight' TUISystemInputAssistantView:0x11b00fe20.height == 45 (active)>",

"<NSLayoutConstraint:0x283f191d0 'assistantView.bottom' TUISystemInputAssistantView:0x11b00fe20.bottom == _UIKBCompatInputView:0x11b05b050.top (active)>",

"<NSLayoutConstraint:0x283f19220 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x11b022990]-(0)-[TUISystemInputAssistantView:0x11b00fe20] (active)>"

)


Will attempt to recover by breaking constraint

<NSLayoutConstraint:0x283f19220 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x11b022990]-(0)-[TUISystemInputAssistantView:0x11b00fe20] (active)>


Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.

The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

2019-11-27 10:53:52.351472+0900 cm-ios[8668:2911641] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFString stringByReplacingCharactersInRange:withString:]: nil argument'

*** First throw call stack:

(0x1af919c30 0x1af6340c8 0x1afc31720 0x1bbbc97b8 0x1b37d5974 0x1b37d5fa4 0x1b74911c8 0x1b37d5df8 0x1b37d5230 0x1b37d50e8 0x1b37fcd70 0x1b37fb6d4 0x1b37fba1c 0x1b37d4ff4 0x1b37d820c 0x1b37d83e4 0x1b37fcd70 0x1b37fb6d4 0x1b37d838c 0x1b37be89c 0x1b34b5f3c 0x1b34b5744 0x1b39e26a8 0x1b7493c64 0x1b7494654 0x1b74884e4 0x1b749174c 0x1af62fd5c 0x1b39b0b44 0x1b305cb6c 0x1b305c9f4 0x1af62fd5c 0x1b39b0b44 0x1b33cd10c 0x1b33cd480 0x1b33cc490 0x1b39eb68c 0x1b39ec97c 0x1b39c8804 0x1b3a42224 0x1b3a447dc 0x1b3a3d960 0x1af895260 0x1af8951b4 0x1af894920 0x1af88f7ec 0x1af88f098 0x1b99f9534 0x1b39af7ac 0x104faba94 0x1af70ef30)

libc++abi.dylib: terminating with uncaught exception of type NSException

=======================================

Replies

The beginning is:

- a begnin keyboard alert

- some issue with the constraints you have defined.


The crash is

2019-11-27 10:53:52.351472+0900 cm-ios[8668:2911641] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFString stringByReplacingCharactersInRange:withString:]: nil argument'


But you should give more context and precise information:

Enter my mobile phone number on the web page and run the Send event

How is this web page created ?

How do you set the content (loadRequest ?)


run the send event :

what do you mean ?

Is it the MailComposer page ?


What is the crash log (not only the message on console) ?


Could you also show the code and show exactly where it crashes.

Focusing on the crash ignores the layout constraint issue, with constraints being generated by IOS. The constraint resolution system is forced to break a constraint when this should not be happening.


I'm experiencing what I think is the same root issue when working with a UITextView inside a UIStackView inside a UIScroll view, where the error messages involves ONLY constraints added by iOS:


2019-12-22 09:17:24.662016-0700 IgCares[43151:3421009] [LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don't want.

Try this:

(1) look at each constraint and try to figure out which you don't expect;

(2) find the code that added the unwanted constraint or constraints and fix it.

(

"<NSLayoutConstraint:0x600000b35720 'assistantHeight' TUISystemInputAssistantView:0x7fa28c5222f0.height == 44 (active)>",

"<NSLayoutConstraint:0x600000b3f4d0 'assistantView.bottom' TUISystemInputAssistantView:0x7fa28c5222f0.bottom == _UIKBCompatInputView:0x7fa28c4b2980.top (active)>",

"<NSLayoutConstraint:0x600000b3f480 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x7fa28c5222f0] (active, names: '|':UIInputSetHostView:0x7fa28e106d20 )>",

"<NSLayoutConstraint:0x600000b3be80 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x7fa28c4b2980] (active, names: '|':UIInputSetHostView:0x7fa28e106d20 )>"

)


Will attempt to recover by breaking constraint

<NSLayoutConstraint:0x600000b3f4d0 'assistantView.bottom' TUISystemInputAssistantView:0x7fa28c5222f0.bottom == _UIKBCompatInputView:0x7fa28c4b2980.top (active)>

Turning off correction for the field in question should resolve the error.