# Using multiple KMP modules in Swift

**URL:** <https://discuss.kotlinlang.org/t/using-multiple-kmp-modules-in-swift/30834>\
**Category:** Multiplatform\
**Created:** [November 4, 2025, 6:43am UTC](https://discuss.kotlinlang.org/t/using-multiple-kmp-modules-in-swift/30834 "2025-11-04T06:43:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomektomek](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@tomektomek](https://discuss.kotlinlang.org/u/tomektomek)\
**Post date:** [November 4, 2025, 6:43am UTC](https://discuss.kotlinlang.org/t/using-multiple-kmp-modules-in-swift/30834/1 "2025-11-04T06:43:30Z")

</div>

For simplicity’s sake let’s consider a following dependency graph:

- kmpA (depends on kmpB)
- kmpB (no deps)
- swiftC (depends on kmpA and swiftD)
- swiftD (depends on kmpB)

I’m trying to pass an object of type X (declared in kmpB) from swiftC to swiftD. Looking at mismatch type compiler error it seems that when kmpA and kmpB are built into xcframework they both expose type X with a different prefix kmpAX and kmpBX so essentially compiler sees them as 2 different types even though they have a common source.

Is there some way to configure `build.gradle.kts` to make sure that we only have one X type and that kmpA is actually using kmpB types? Please bear in mind I’m coming from Swift env and don’t have much experience with android or gradle.
