New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking TCA breaks on-device Xcode Previews #57
Comments
(I should add that I tried the traditional ⇧⌘K/DerivedData incantations, but no luck) |
@LK Thanks for the report! I think this might have to do with the fact that we've explicitly marked the products as
I'm unable to verify, though, because for whatever reason I can't get any preview working on my device 😅 Removing Can you try the following to see if you can verify?
|
Good catch @stephencelis, that did fix on-device Previews in the SwiftUICaseStudies project. However this breaks any project that's split up into multiple frameworks:
|
Yep 😔 This is why we made that configuration in the first place, hoping to get around SPM quirks. A related issue is happening in this PR: #52 The short of it is that it's not really safe to define a target like ComposableArchitectureTestSupport that depends on a target like ComposableArchitecture from the same package. Apple knows about this issue, but the only current SPM workaround that we can depend on will require us to move ComposableArchitectureTestSupport to its own package/repo, making the user experience of adopting the library slightly more annoying. Hopefully Apple can come up with a solution to this soon! (Next month? 🤞) In the meantime, Brandon and I will chat next steps in how we wanna address this. |
We're working on fixing this in #70, which has consolidated everything we know about the issue. Gonna close this in favor of tracking that one! |
@stephencelis SwiftUICaseStudies works now. Trying to run the TicTacToe app on device crashes on launch with this error (yet it works fine in the simulator):
Trying to start an on-device Xcode Preview from the TicTacToe project fails with the following error:
(Regular Xcode Previews in the sidebar still work, though.) Not sure if related but I also get a slew of these warnings: |
Good catch! I'll play around with it but this may just be another Xcode previews bug around modularized apps. If we can't fix we'll file a feedback.
Those warnings are unrelated. We should probably clean them up, though. |
Sounds good! To clarify, the first error comes from trying to run the entire app like normal; the second error is specific to Xcode Previews. |
@LK You're right. TicTacToe wasn't in building order for device anyhow. We've pushed a fix for that but the |
Describe the bug
Adding TCA as a dependency prevents on-device Xcode Previews from launching.
To Reproduce
This reproduces on the provided examples (I tried it on
TicTacToe
), but for a simple repro:Note that this happens even if the
ComposableArchitectureTestSupport
is not added to any target.Expected behavior
Xcode Previews continues to work as expected.
Screenshots
N/A
Environment
Additional context
I'm no expert on how the Xcode build system works, but I didn't see anything obviously wrong in the build config at first glance; I'm not sure how or why it's trying to link
ComposableArchitectureTestSupport
. I then assumed this was a bug with the Xcode build system, but after trying it on another repository with a test support target (https://github.com/spotify/Mobius.swift) it seems like they don't have the same issue, so maybe there's something deeper going on.The text was updated successfully, but these errors were encountered: