Build error(s) - Undefined symbols when used as a transitive dependency
maddapper opened this issue · 3 comments
Description
When I have a main project that depends on SwiftUI Navigation and an internal framework that also depends on SwiftUI Navigation, the build fails with this error:
Undefined symbol: CasePaths.AnyCasePath.init(embed: (B) -> A, extract: (A) -> B?) -> CasePaths.AnyCasePath<A, B> Undefined symbol: nominal type descriptor for CasePaths.AnyCasePath Undefined symbol: protocol descriptor for CasePaths.CasePathable
Interestingly, when I try the same configuration with just CasePaths, my project was able to build successfully. I'm assuming SPM builds these dependencies as dynamic frameworks since they are transitively referenced. I know it's not a versioning issue, since I use exact versions. I think this is a bug in SwiftUI Navigation. Thank you!
Checklist
- I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
- If possible, I've reproduced the issue using the
main
branch of this package. - This issue hasn't been addressed in an existing GitHub issue or discussion.
Expected behavior
When including SwiftUI Navigation in both the main project and internal framework, I expect the build to be successful.
Actual behavior
Build fails with this error:
Undefined symbol: CasePaths.AnyCasePath.init(embed: (B) -> A, extract: (A) -> B?) -> CasePaths.AnyCasePath<A, B> Undefined symbol: nominal type descriptor for CasePaths.AnyCasePath Undefined symbol: protocol descriptor for CasePaths.CasePathable
Steps to reproduce
- create a main project
- add SwiftUI Navigation via SPM
- create an internal framework project
- add SwiftUI Navigation via SPM
- build
SwiftUI Navigation version information
1.2.1
Destination operating system
iOS 17
Xcode version information
Version 15.3 (15E204a)
Swift Compiler version information
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
Hi @maddapper, can you please provide a project path demonstrates the behavior?
@mbrandonw it might be a build setting that is causing this behavior, so I'm trying to see what differences there are in my build settings.
Yes, I highly doubt it is an issue with this library. It's a pretty simple SPM package.
I am going to convert this to a discussion and please feel free to continue the conversation over there.