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

Efe

12/12/2018, 10:02 AM
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

h0tk3y

12/12/2018, 1:33 PM
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

Efe

12/12/2018, 1:45 PM
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

h0tk3y

12/12/2018, 5:40 PM
It should definitely appear after you run
./gradlew build
.
z

Zachary Smith

12/16/2018, 9:16 PM
@Efe i am having the same problem with the bin directory no showing up. were you ever able to resolve the issue?
e

Efe

12/16/2018, 9:42 PM
Hi, actually i did thanks to @h0tk3y ./gradlew build comment does generate the bin and the framework file.
Did you try that?
5 Views