I'm on Xcode 12.5 and have been getting a beach ball every 5/6 seconds for about a second. I noticed it mostly while editing source code files. I tried all the things mentioned in this thread with no luck (turning wifi off, I didn't have any devices at all in the Devices window, etc.). I think it was specific to the project.
At the top of the source code pane is a row of files that were previously opened. I removed all of those files and the problem seems to have been fixed. I probably had 50 files listed in there and had two editor panes open side by side. Option-click removes all the files at once.
This seems to have worked for me.
Post
Replies
Boosts
Views
Activity
I found that the tableView is added to the window after viewWillAppear() and before viewDidAppear(). My code was setting a selection in the tableView and needed to call tableView.cellForRowAtIndexPath() and that was causing the tableView to layout and generated this error. Once I moved my selection code from viewWillAppear() to viewDidAppear() the error went away.
@frameworksengineer I'm also running into this in iOS 15 in a UIKit app. When it happens the textField isn't visible anymore, although I still see it in the View Debugger. I think it happens when I enter some text and then tap outside the textField.
I see the Assert warnings a number of times and also this one:
WARNING: Calling updateFocusIfNeeded while a focus update is in progress. This call will be ignored.
I did what you ask and the UITextField.interactions[UITextInteraction].textInput property is simply the UITextField.
(lldb) po (UITextField*)0x7f9fd7c2d200
<UITextField: 0x7f9fd7c2d200; frame = (0 0; 484 25); opaque = NO; gestureRecognizers = <NSArray: 0x7f9fc685d6f0>; text = '1.99'; borderStyle = None; background = <_UITextFieldNoBackgroundProvider: 0x7f9fe29e0120: textfield=<UITextField 0x7f9fd7c2d200>>; layer = <CALayer: 0x7f9fe29e3f20>>
(lldb) po ((UITextField*)0x7f9fd7c2d200).interactions
<__NSArrayI 0x7f9fccbb1600>(
<UIDragInteraction: 0x7f9fc68702b0>,
<UIDropInteraction: 0x7f9fc6830220>,
<_UITextMenuLinkInteraction: 0x7f9fc6880dd0>,
<UIContextMenuInteraction: 0x7f9fc6881600>,
<_UIClickPresentationInteraction: 0x7f9fc68819e0>,
<UIPointerInteraction: 0x7f9fc6875dc0>,
<_UIKeyboardBasedTextSelectionInteraction: 0x7f9fc4b71ef0>,
<UITextInteraction: 0x7f9fc4b905a0>,
<UITextLoupeInteraction: 0x7f9fc4b52d10>,
<UITextSelectionInteraction: 0x7f9fc4be4620>,
<UITextIndirectKeyboardInteraction: 0x7f9fc4bfed80>,
<UITextIndirectEditableInteraction: 0x7f9fe17fc190>,
<UITextLoupeInteraction: 0x7f9fe17c0d70>,
<UITextSelectionInteraction: 0x7f9fdb696510>
)
(lldb) po (UITextInteraction*)0x7f9fc4b905a0
<UITextInteraction: 0x7f9fc4b905a0>
(lldb) po ((UITextInteraction*)0x7f9fc4b905a0).textInput
<UITextField: 0x7f9fd7c2d200; frame = (0 0; 484 25); opaque = NO; gestureRecognizers = <NSArray: 0x7f9fc685d6f0>; text = '1.99'; borderStyle = None; background = <_UITextFieldNoBackgroundProvider: 0x7f9fe29e0120: textfield=<UITextField 0x7f9fd7c2d200>>; layer = <CALayer: 0x7f9fe29e3f20>>
After more investigation it looks like the problem was caused by removingFromSuperview() the textField while it was being edited. My code was removing and re-adding the textField. Removing that code seems to have fixed this. My textField is in a tableView and calling reloadData() while the textField is being edited causes the Warning about updateFocusIfNeeded but that seems to be benign.
I always try to close my projects before switching branches. Even if the SPM dependencies are the same in the two branches it downloads them again. If I close the project, then switch the branch, then reopen the project it doesn't download the dependencies again.
I have Package.resolved in git since they could be different in the different branches.
Just as an FYI, this is related to a long-standing bug in sqlite reported at least in 2012 for multiple platforms. I'm seeing the same stack trace starting at your frame 7. My failing code is in a third-party library that's accessing a local sqlite db when the app goes to the background. Apparently, the wal-index file is mmaped and accessing that file fails when the app goes to the background and sqlite doesn't handle this in a friendly way.
https://bugzilla.mozilla.org/show_bug.cgi?id=771138
https://www.sqlite.org/wal.html#noshm