Weird crash with keyboardLayoutGuide in ios 26

22 hours ago 4
ARTICLE AD BOX

I have this feature which was working just fine until one day, it crashes when I push another VC or pop to previous VC. the crash log says:

Assertion failure in void _engineVar_rawRemove(NSISEngineVar)(), NSISEngine_EngineVar.h:181 Not possible to remove variable: 1020: <unknown var (bug!) with engine as delegate: {id: } colIndex:280 from engine <NSISEngine: >{ delegate: Thread 1: "Not possible to remove variable: 1020: <unknown var (bug!) with engine as delegate:0x60000191c240>{id: 9200} colIndex:280 from engine <NSISEngine: 0x105a65e80>{ delegate:0x103ed90f0 EngineVars: 0: objective{id: 24} rowIndex:0 1: UIKeyboardLayoutGuide:0x105890430'UIWindow_KeyboardLayoutGuide'.Width{id: 948} rowIndex:1 2: 0x6000021914a0:UIKeyboardLayoutGuide-width.marker{id: 947} colIndex:1 3: UIKeyboardLayoutGuide:0x105890430'UIWindow_KeyboardLayoutGuide'.minX{id: 950} rowIndex:2 4: 0x600002190eb0:UIKeyboardLayoutGuide-leftOffset.marker{id: 949} colIndex:2 5: UIKeyboardLayoutGuide:0x105890430'UIWindow_KeyboardLayoutGuide'.minY{id: 952} rowIndex:1073741824 6: UIKeyboardLayoutGuide:0x105890430'UIWindow_KeyboardLayoutGuide'.Height{id: 953} rowIndex:1073741825 7: 0x600002191a40:UIKeyboardLayoutGuide-bottomOffset.marker{id: 951} colIndex:1073741826 8: 0x600002190c80:UIKeyboardLayoutGuide-height.marker{id: 954} colIndex:1073741824 9: UIView:0x105aecdc0.Height{id: 2562} rowIndex:1073741"

This crash log is weird, I've never seen a crash like this before (i've been developing iOS app for over 10 years).

After thinking a while, I suspected this line of code here is what caused the crash:

continueButton.snp.makeConstraints { make in make.height.equalTo(48) make.horizontalEdges.equalToSuperview().inset(16) // This one make.bottom.equalTo(view.keyboardLayoutGuide.snp.top).offSet(-12) }

To confirm my suspicion, I removed this constraint with keyboardLayoutGuide and just replace it with a constraint to bottom (which is not desired). that actualy make the app working without crashed. I thought it was a snapkit issue but it's not, as i removed the snapkit and used NSLayoutConstraint.active, the crash still occurs.

So, I'm writing this to ask what's happening here? I have another VC (pushed to this one), which use the same code and doesn't crash.

It wasn't crashed in previous iOS version. When I first upgrade to ios26 and xcode 26, it didn't crashed too (the production app is working just fine).

Read Entire Article