https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Roland

10/10/2023, 12:12 PM
I migrated my multiplatform project to multi module. The structure of the shared modules is following
:Module_1
:Module_2
:Module_2
depends on
:Module_1
If I now call e.g. a data class from framework in xcode it's named
Module_1MyDataclass.
Tested on kotlin 1.9.10 and 1.9.20-Beta2 How to avoid this behavior?
m

mkrussel

10/10/2023, 12:19 PM
r

Roland

10/10/2023, 12:47 PM
Sorry I don't get it. I currently have in Module 2 the dependency of Module 1
Copy code
val commonMain by getting {
    dependencies {
implementation(project(":module_1))
    }
}
For both modules are frameworks created. Do you have any example for multi module I'm KMP?
m

mkrussel

10/10/2023, 1:06 PM
I don't, but the documentation I linked shows an example. Somewhere in your code you have a place where you are specifying that you want a framework binary as an output. Inside that block, you need to export the dependent modules (module 1). So you need to list the dependencies twice. Once in your source sets and once in your binaries.
👍 1
2 Views