hi guys, I have created a sample mpp project for M...
# multiplatform
e
hi guys, I have created a sample mpp project for Mobile Shared Library. I was able to add the jar file, that I build with ‘jarJvm’ gradle task, into the android project. (a separate project) I am able to build a ‘.klib’ file when I run the ‘iosKlibrary’ task. the problem is, how am I supposed to add that lib to the ios project.
h
Hi, The Kotlin/Native
*.klib
artifacts are not actual binaries, they contain the LLVM bitcode and some Kotlin metadata, and they are supposed to be consumed by the Kotlin/Native compiler as a dependency. They are not suitable for use as binary libraries. To use a Kotlin/Native library with iOS, you actually need to build an Objective-C framework from the iOS target. Please see this tutorial for the exact setup steps: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html
e
Thanks @h0tk3y
_The SharedCode build generates iOS frameworks for use with the Xcode project. All frameworks are in the SharedCode/build/bin folder. _
but there is no bin directory in my build dir.
is there a special gradle command that I should call? here is my build.gradle;
h
It should definitely appear after you run
./gradlew build
.
z
@Efe i am having the same problem with the bin directory no showing up. were you ever able to resolve the issue?
e
Hi, actually i did thanks to @h0tk3y ./gradlew build comment does generate the bin and the framework file.
Did you try that?