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

Mike Wolfson

08/26/2019, 9:29 PM
This_is_the_build_gradle_kts_file__not_sure_where_I_need_to_add_any_particular_association_to_make_this_work___I_do_have_the_JVM_set_to__android___as_per_default_.txt
🧵 1
k

Kris Wong

08/26/2019, 9:35 PM
that's the name. it doesn't mean anything.
m

Mike Wolfson

08/26/2019, 9:36 PM
I guess I will take this to StackOverflow, I am not clear what you are describing, and don't want to consume this channel.
Pretty sure I need some config in the kotlin{} section of this gradle file, but I have no idea what that is supposed to be
k

Kris Wong

08/26/2019, 9:38 PM
if you want to use the android SDK, you have to make it an Android library. have you ever created an android library?
m

Mike Wolfson

08/26/2019, 9:38 PM
OK, that is good to know
l

louiscad

08/27/2019, 7:57 AM
@Mike Wolfson You want to read that documentation that covers Android support: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html
m

Mike Wolfson

08/27/2019, 12:52 PM
I did read that documentation and the portions of the gradle file that I need are just comments: '''plugins { id("com.android.library") kotlin("multiplatform").version("1.3.50") } android { /* ... */ } kotlin { android { // Create the Android target // Provide additional configuration if necessary } }'''
I have also searched GitHub to try and find a better example of this.
k

Kris Wong

08/27/2019, 12:59 PM
the android bits are the same as any android library
I am about to start working on a blog post that will address this specifically, but sadly it will be a few weeks before it would go live
l

louiscad

08/27/2019, 2:27 PM
This module depends on
buildSrc
content and supports Android, macOS and iOS: https://github.com/LouisCAD/Splitties/blob/5a12cda203e5c1069ef29528231cfd2dcb6d97e9/modules/preferences/build.gradle.kts IDE works fine for me in Android Studio 3.5.0 with Kotlin 1.3.50, for both Android and iOS/macOS sources. Trying it from your IDE might be helpful. Be sure to clone/download this revision or the develop branch.
m

Mike Wolfson

08/27/2019, 3:50 PM
Thanks for the example, I am sure that will be super helpful...especially since it looks like it is using the plugins DSL