https://kotlinlang.org logo
c

coletz

10/12/2018, 9:33 AM
Hi everyone! I'm following the official mpp tutorial (here https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-the-shared-module) using AS. I'm not getting this part:
Let's start by creating the SharedCode project
. Should I actually create a NEW project or just use the one I've created for android (following previous tutorial steps) and create a new module? In case, what type of project/module (phone & tablet module, android library, java library etc.)?
l

Liliia

10/12/2018, 10:28 AM
I believe @jonnyzzz may help here
j

jonnyzzz

10/12/2018, 10:57 AM
We have a multiproject Gradle project here. And it is nothing more than creating yet another sub-project or module. You may just follow the instructions and you’ll have it added to your project quite soon
c

coletz

10/12/2018, 11:10 AM
Ok so I'm probably having an issue (or I just misconfigured something). I tried copying the SharedCode/build.gradle file and now gradle sync fails:
Copy code
No signature of method: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation.outputKinds() is applicable for argument types: (java.lang.String) values: [FRAMEWORK]
Possible solutions: getOutputKinds(), setOutputKinds(java.util.List)
. Ever heard about this error?
j

jonnyzzz

10/12/2018, 3:34 PM
No, I have not seed that. Please make sure you have Gradle 4.10.2 and you use the 1.3-rc<LATEST> Kotlin plugin in Gradle. You may also check that you have not have any other plugins included. If all of that does not work, please include your zipped project as an issue for Kotlin in youtrack.jetbrains.com
c

coletz

10/12/2018, 8:38 PM
the problem was with kotlin version for gradle plugin, I used 1.3-M1... Then I've understood that that's not a valid version :S sorry for the time spent
l

Lukas Lechner

11/26/2018, 8:06 PM
Hi! I also do not understand the part with
Let's start by creating the SharedCode project
. How did you finally get it working @coletz? Did you create a new module with the wizard in Android Studio or IntelliJ or did you create a completely new Mobile Shared Library project? @jonnyzzz. Thank you!
c

coletz

11/26/2018, 8:10 PM
IIRC I just created a normal kotlin module in intellij
j

jonnyzzz

11/26/2018, 10:24 PM
That was not about creating the project in IntelliJ/Android Studio. It was only about creating yet another Gradle sub project. It should be explained in the text. I’ll fix the text to make it state it clearly. Sorry, I missed the previous notification (
The goal of the tutorial is to demonstrate Kotlin code re-use between Android and iOS. Let’s start by creating the
SharedCode
sub-project in our Gradle project. The source code from the
SharedCode
project will be shared between platforms. We will create several new files in our project to implement that.
l

Lukas Lechner

11/28/2018, 6:03 PM
Thank you very much @coletz and @jonnyzzz