I’ve got a `backend` multiplatform module where I ...
# multiplatform
v
I’ve got a
backend
multiplatform module where I have my DTO’s with kotlin multiplatform serialization:
Copy code
@Serializable data class VerifyEmailRequest(
  @SerialName("email") val email: String,
  @SerialName("dev") val dev: String
)
and a
shared
module which pulls that one in:
Copy code
sourceSets["commonMain"].dependencies {
  implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
  api(project(":backend"))
}
I’m using the
packForXcode
from https://github.com/kotlin-hands-on/mpp-ios-android/blob/8cfc677610d2d469b6201155a5d5d513a46d6e89/SharedCode/build.gradle.kts#L35 Referencing
VerifyEmailRequest
within my Android application works without any problems. On iOS I can’t seem to get a reference on it. The type can’t be found. The only way I can get it to work is if I reference the class from
shared
and expose it via a function:
Copy code
fun foo() = VerifyEmailRequest("email", "dev")
Is this a known issue? I have set
transitiveExport
to true for iOS so I’d imagine everything to be working.