I am developing a Log-In screen using XCode 15.2 and the latest version of SwiftUI that is shipped in Xcode.
The Simulator I use is the iPhone 15 Pro.
The Log-In Screen has two TextFields one contains the Users Email Address and the other is a SecureField which is used for the Password.
The code for the TextFields are:
TextField("Email Address", text: $userData.Email)
.frame(width: UIScreen.main.bounds.width - 100)
.textFieldStyle(.roundedBorder)
.textInputAutocapitalization(.never)
.opacity(0.8)
SecureField("Password", text: $userData.Password)
.frame(width: UIScreen.main.bounds.width - 100)
.textFieldStyle(.roundedBorder)
.opacity(0.8)
When I run this in the Simulator, all looks fine, but as soon as I click into either TextField, I see the following in the Debug area.
Error for queryMetaDataSync: 2
Error for queryMetaDataSync: 2
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:0x6000021735c0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x106839040.bottom == _UIKBCompatInputView:0x1068374d0.top (active)>",
"<NSLayoutConstraint:0x6000021623f0 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x10681fc80 )>",
"<NSLayoutConstraint:0x6000021731b0 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x1068374d0.top (active, names: SystemInputAssistantView:0x10681fc80 )>",
"<NSLayoutConstraint:0x600002173110 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x106839040]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10681fc80 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002173110 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x106839040]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10681fc80 )>
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.
I don't understand what is driving this error. Reading the error it mentions 'remote keyboard'
What does get my attention is the following line:
"<NSLayoutConstraint:0x6000021623f0 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x10681fc80 )>"
I don't know if something needs to be a height of 45 or I have set a height of 45 somewhere, which I am unable to find anywhere.
What can I try next?