c

    coletz

    3 years ago
    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.)?
    Liliia

    Liliia

    3 years ago
    I believe @jonnyzzz may help here
    j

    jonnyzzz

    3 years ago
    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

    3 years ago
    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:
    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

    3 years ago
    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

    3 years ago
    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
    Lukas Lechner

    Lukas Lechner

    3 years ago
    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

    3 years ago
    IIRC I just created a normal kotlin module in intellij
    j

    jonnyzzz

    3 years ago
    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.
    Lukas Lechner

    Lukas Lechner

    3 years ago
    Thank you very much @coletz and @jonnyzzz