Closed caesar84mx closed 4 years ago
hello!
in your case prefix Mvvm
added because you not add moko-mvvm
into export libraries for framework.
in sample it done with mobile-multiplatform-gradle-plugin - https://github.com/icerockdev/moko-mvvm/blob/22b50b8919c565d2de24738c9183c93cc475fdc7/sample/mpp-library/build.gradle.kts#L22
if you not use this plugin you should use this guide - https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#exporting-dependencies-in-frameworks
when you export dependencies into framework header prefix Mvvm
not added
Thanks for your response. I did as you said and now I'm having the following in my module's build.gradle:
targets {
android()
iosArm64("iosArm64")
iosX64("iosX64")
configure([iosArm64, iosX64]) {
binaries {
framework {
baseName = "MultiPlatformLibrary"
transitiveExport = true
}
}
}
}
And:
iosX64 {
binaries {
framework("MultiPlatformLibrary") {
export "dev.icerock.moko:mvvm-iosx64:$moko_mvvm_version"
}
}
}
iosArm64 {
binaries {
framework("MultiPlatformLibrary") {
export "dev.icerock.moko:mvvm-iosarm64:$moko_mvvm_version"
}
}
}
Now the library is being compiled without class names alteration. But when I try to build an iOS project in Xcode, I have the following:
enable generics support please https://kotlinlang.org/docs/reference/native/objc_interop.html#generics
A huge thanks to you, it finally worked 👍
The Swift extensions for Moko LiveData are failed to compile with "Use of undeclared type LiveData" message. It happens because after compiling the shared library the respective class names have "Mvvm" prefix. Moreover, when I change the names to the correct ones, happens that they don't have generics which leads to new compilation errors.