Kotlin Multiplatform iOS builds can break in Swift 6.3 due to nested 'State' name clash
A Kotlin Multiplatform project began failing on iOS after upgrading to Xcode 26.4, which shipped Swift 6.3, despite no changes to the codebase. The root cause was a naming conflict between SwiftUI's @State property wrapper and the nested State classes exported from shared Kotlin ViewModels. When Xcode's batch compilation mode grouped multiple Swift files together, the compiler confused the two identically named types, producing a nonsensical error message. The team resolved the issue by disabling SWIFT_ENABLE_BATCH_MODE and adding typealiases in Swift files to give the Kotlin State types distinct local names. Neither fix alone was sufficient, and the combination restored a green build without requiring any changes to the shared Kotlin code.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in