Wierd crash on iOS 14 using TCA .alert()

So currently im working on a project supporting iOS 14 and above, and for some reason the app crashes (only iOS 14,) when opening a view with the .alert tca syntax inside, for example:

 .alert(
      store.scope(state: \.alert),
      dismiss: .alertDismissed
 )

The error i get the following. Its pretty damn hard to debug, but i figured out that the crash occurred only when the .alert initialiser was used in the view code:


The wierd thing is that the code works perfectly fine on iOS 15.
I have tried to reproduce the issue in another iOS 14 app, but the error didn't happen there. It only happens in this damn app. Sooo im actually pretty clueless what is going on. Does anyone know what this issue could be about? I guess an alternative could be to use the alert(isPresented:content:) initialiser instead, but would really like to use the tca version if possible

Do you have a project that you can share that reproduces the problem?

Given the stack it may be an unrelated issue, in particular the app state may have gotten too big and need to be boxed. Check out this discussion for more info: Potential for stack overflow with large app states · Discussion #488 · pointfreeco/swift-composable-architecture · GitHub

Thank you for the response Stephen! :fist:

I figured out that the issue with the alert only happened when building from Xcode 13.1 or 13.2. With 13.0 everything was fine and I could not reproduce the crash, so it guess it could be a Xcode problem with iOS 14 simulators?

This seems to be related to this issue, which was opened just yesterday. Looks like it only affected Xcode 13.1+ building for iOS 14 in release mode. We found a fix and released a new version, so if you update to TCA 0.31.0 things should work again!

1 Like

Lets go! cool it could be reproduced. thank you so much

Terms of Service

Privacy Policy

Cookie Policy