SwiftUI is crashing when changing the tabs

The app is working fine in iOS 15 and above but crashing on the below OS versions. We've 4 tabs (buttons) to update the UI, not sure where exactly it's crashing. Tried with .id(uuid()) but its not working. Please help me.

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x746e6f436465698e)

  frame #0: 0x00000001c8c3b638 AttributeGraphAG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 112   frame #1: 0x00000001c8c4d988 AttributeGraphAGGraphGetValue + 304   frame #2: 0x00000001c8c4d670 AttributeGraphAGGraphGetInputValue + 68   frame #3: 0x00000001a82968b8 SwiftUISwiftUI.ViewCache.children(context: AttributeGraph.AnyRuleContext) -> SwiftUI._IncrementalLayout_Children + 120   frame #4: 0x00000001a829d70c SwiftUIclosure #1 (inout τ_0_0.State) -> Swift.Optional<__C.CGRect> in closure #1 (τ_0_0, SwiftUI._IncrementalLayout_PlacementContext) -> Swift.Optional<__C.CGRect> in closure #1 (__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint> in SwiftUI.IncrementalScrollable.makeTarget(at: Swift.Int, anchor: Swift.Optional<SwiftUI.UnitPoint>) -> Swift.Optional<(__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint>> + 108   frame #5: 0x00000001a829d7b8 SwiftUIreabstraction thunk helper <τ_0_0 where τ_0_0: SwiftUI.IncrementalLayout> from @callee_guaranteed (@inout τ_0_0.SwiftUI.IncrementalLayout.State) -> (@unowned Swift.Optional<__C.CGRect>) to @escaping @callee_guaranteed (@inout τ_0_0.SwiftUI.IncrementalLayout.State) -> (@out Swift.Optional<__C.CGRect>) + 40   frame #6: 0x00000001a82a03dc SwiftUIpartial apply forwarder for closure #1 (Swift.UnsafeMutablePointer<τ_0_0.State>) -> τ_1_1 in SwiftUI._ViewCache.withMutableState<τ_0_0, τ_0_1>(type: τ_1_0.Type, _: (inout τ_1_0) -> τ_1_1) -> τ_1_1 + 28   frame #7: 0x00000001a56de5e4 libswiftCore.dylibSwift.withUnsafeMutablePointer<τ_0_0, τ_0_1>(to: inout τ_0_0, _: (Swift.UnsafeMutablePointer<τ_0_0>) throws -> τ_0_1) throws -> τ_0_1 + 28   frame #8: 0x00000001a82990f8 SwiftUISwiftUI._ViewCache.withMutableState<τ_0_0, τ_0_1>(type: τ_1_0.Type, _: (inout τ_1_0) -> τ_1_1) -> τ_1_1 + 304   frame #9: 0x00000001a829d668 SwiftUIclosure #1 (τ_0_0, SwiftUI._IncrementalLayout_PlacementContext) -> Swift.Optional<__C.CGRect> in closure #1 (__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint> in SwiftUI.IncrementalScrollable.makeTarget(at: Swift.Int, anchor: Swift.Optional<SwiftUI.UnitPoint>) -> Swift.Optional<(__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint>> + 248   frame #10: 0x00000001a829d814 SwiftUIreabstraction thunk helper <τ_0_0 where τ_0_0: SwiftUI.IncrementalLayout> from @callee_guaranteed (@in_guaranteed τ_0_0, @in_guaranteed SwiftUI._IncrementalLayout_PlacementContext) -> (@unowned Swift.Optional<__C.CGRect>) to @escaping @callee_guaranteed (@in_guaranteed τ_0_0, @in_guaranteed SwiftUI._IncrementalLayout_PlacementContext) -> (@out Swift.Optional<__C.CGRect>) + 40   frame #11: 0x00000001a8299378 SwiftUISwiftUI._ViewCache.withPlacementData<τ_0_0>((τ_0_0, SwiftUI._IncrementalLayout_PlacementContext) -> τ_1_0) -> τ_1_0 + 292   frame #12: 0x00000001a829d2d0 SwiftUIclosure #1 (__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint> in SwiftUI.IncrementalScrollable.makeTarget(at: Swift.Int, anchor: Swift.Optional<SwiftUI.UnitPoint>) -> Swift.Optional<(__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint>> + 336   frame #13: 0x00000001a82a3a9c SwiftUIpartial apply forwarder for closure #1 (__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint> in SwiftUI.IncrementalScrollable.makeTarget(at: Swift.Int, anchor: Swift.Optional<SwiftUI.UnitPoint>) -> Swift.Optional<(__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint>> + 56   frame #14: 0x00000001a86f11fc SwiftUISwiftUI.HostingScrollView.updateAnimationTarget((__C.CGSize, __C.CGRect) -> Swift.Optional<__C.CGPoint>) -> () + 216   frame #15: 0x00000001a86f15c4 SwiftUISwiftUI.HostingScrollView.bounds.didset : __C.CGRect + 188   frame #16: 0x00000001a86f14e8 SwiftUISwiftUI.HostingScrollView.bounds.setter : __C.CGRect + 128   frame #17: 0x00000001a86f144c SwiftUI@objc SwiftUI.HostingScrollView.bounds.setter : __C.CGRect + 44   frame #18: 0x00000001a4961e4c UIKitCore-[UIScrollView setContentOffset:] + 804   frame #19: 0x00000001a497e0e4 UIKitCore-[UIScrollView _setContentOffset:animated:animationCurve:animationAdjustsForContentOffsetDelta:animation:animationConfigurator:] + 824   frame #20: 0x00000001a86f07e4 SwiftUISwiftUI.HostingScrollView.updateContent(offset: __C.CGPoint, frame: __C.CGRect, safeAreaInsets: SwiftUI.EdgeInsets, layoutDirection: SwiftUI.LayoutDirection, mode: SwiftUI.SystemScrollViewState.ContentOffsetMode, isEnabled: Swift.Bool) -> () + 528   frame #21: 0x00000001a849ba1c SwiftUISwiftUI.UpdatedHostingScrollView.updateValue() -> () + 544   frame #22: 0x00000001a8278498 SwiftUIpartial apply forwarder for generic specialization <SwiftUI.HostingScrollView, SwiftUI.UpdatedHostingScrollView> of implicit closure #2 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in implicit closure #1 (τ_1_0.Type) -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer<τ_1_0>) -> AttributeGraph.Attribute<τ_0_0> in AttributeGraph.Attribute.init<τ_0_0 where τ_0_0 == τ_1_0.Value, τ_1_0: AttributeGraph.StatefulRule>(τ_1_0) -> AttributeGraph.Attribute<τ_0_0> + 24   frame #23: 0x00000001c8c36194 AttributeGraphAG::Graph::UpdateStack::update() + 492   frame #24: 0x00000001c8c365c8 AttributeGraphAG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 332   frame #25: 0x00000001c8c3b664 AttributeGraphAG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 156   frame #26: 0x00000001c8c4d988 AttributeGraphAGGraphGetValue + 304   frame #27: 0x00000001a83fec58 SwiftUISwiftUI.ViewGraph.displayList() -> (SwiftUI.DisplayList, SwiftUI.DisplayList.Version) + 60   frame #28: 0x00000001a88472e4 SwiftUIclosure #1 () -> () in SwiftUI.ViewRendererHost.render(interval: Swift.Double, updateDisplayList: Swift.Bool) -> () + 2108   frame #29: 0x00000001a8846274 SwiftUISwiftUI.ViewRendererHost.render(interval: Swift.Double, updateDisplayList: Swift.Bool) -> () + 336   frame #30: 0x00000001a89b86e0 SwiftUISwiftUI._UIHostingView.displayLinkTimer(timestamp: SwiftUI.Time) -> () + 172   frame #37: 0x00000001a1b24440 CoreFoundation__CFRunLoopDoSource1 + 596   frame #38: 0x00000001a1b1e320 CoreFoundation__CFRunLoopRun + 2360   frame #39: 0x00000001a1b1d4bc CoreFoundationCFRunLoopRunSpecific + 600   frame #40: 0x00000001b85a2820 GraphicsServicesGSEventRunModal + 164   frame #41: 0x00000001a44c1734 UIKitCore-[UIApplication _run] + 1072   frame #42: 0x00000001a44c6e10 UIKitCoreUIApplicationMain + 168  * frame #43: 0x0000000100c71e64 FiosTVmain at AppDelegate.swift:17:7   frame #44: 0x00000001a17e4e60 libdyld.dylib`start + 4

Show us code instead pretty much what you're doing.

SwiftUI is crashing when changing the tabs
 
 
Q