• Hannes

    Hannes

    2 years ago
    Hi, I'm new to kotlin multiplatform and I want to create a multiplatform library using coroutines and
    Flow
    . Is there any material how to get started with that? I looked into existing multiplaform libraries configs on github and copied most
    build.gradle
    config but I get a lot of
    unresolved reference
    errors while compiling:
    library/src/commonMain/kotlin/com/freeletics/flowredux/FlowRedux.kt: (7, 32): Unresolved reference: Flow
    Hannes
    louiscad
    +1
    9 replies
    Copy to Clipboard
  • Joey

    Joey

    2 years ago
    Can someone give me technique on how to listen for button state (android/iOS) in common code?
    Joey
    s
    +3
    11 replies
    Copy to Clipboard
  • j

    JoakimForslund

    2 years ago
    Question, I'm using Kotlin Multiplatform 1.3.50. I'm trying to move away from running android in a multiplatform-library under the folder
    main
    into
    androidMain
    I've added this onto the android-library extension:
    sourceSets.forEach {
            val root = "src/androidMain/${it.name}"
            val manifestFile = file("src/androidMain/AndroidManifest.xml")
            it.setRoot(root)
            it.java.setSrcDirs(fileTree("${root}/kotlin"))
            it.manifest.srcFile(manifestFile)
        }
    which seems to at least make everything look in the right place. However, now my
    expect/actual
    in my common starts to complain that it can not find the actual implementation for jvm set up, which is weird, because I have not setup a target for jvm, and the implementation it should be looking for, does exist within the
    androidMain
    folder, but it does not look for it there, how can I change that?
    j
    Sebastian Sellmair [JB]
    8 replies
    Copy to Clipboard
  • egorand

    egorand

    2 years ago
    I’ve bumped a multiplatform library to 1.3.60 and
    jsNodeTest
    started failing with the following message:
    Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
    I’m completely fine with the tests taking longer than 2s in this case, are there any configuration options that would allow ignoring this error?
    egorand
    Ilya Goncharov [JB]
    2 replies
    Copy to Clipboard
  • f

    Fabio Bombardi

    2 years ago
    Dumb question. With this simple kotlin-mpp template https://github.com/shadowsheep1/kotlin-mpp-playground if I switch to Android visualisation I cannot see
    androidMain
    and
    androidTest
    folders. Any ideas of the reason I cannot see them?
    f
    Sebastian Sellmair [JB]
    +1
    9 replies
    Copy to Clipboard
  • m

    Max Raskin

    2 years ago
    Hi, in a Kotlin MPP, is there a clean way of serializing a Map<String, Any> to a JSON string? I've tried doing it using kotlinx.serialization but it seems to support only classes annotated with @Serializable, am I missing something? Thanks 🙂
    m
    1 replies
    Copy to Clipboard
  • d

    Dmitri Sh

    2 years ago
    with an expected class in shared, not possible to have any method implementation? All methods must be actualized in platform specific actuals? I have a class (decorator) that can have some of its methods actually implemented in shared - but am forced to duplicate the code in actuals. Is this (no pun intended) "expected"? Seems like a waste.
    d
    k
    2 replies
    Copy to Clipboard
  • Joey

    Joey

    2 years ago
    How to publish shared library / multiplatform library in jitpack?
    Joey
    kpgalligan
    2 replies
    Copy to Clipboard
  • m

    msink

    2 years ago
    I'm lost in generic expect/actual common:
    expect class WeakReference<T>(instance: T) {
        fun get(): T?
    }
    jvm:
    actual typealias WeakReference<T> = java.lang.ref.WeakReference<T>
    native:
    actual typealias WeakReference<T> = kotlin.native.ref.WeakReference<T>
    jvm works, native fails with message "The following declaration is incompatible because upper bounds of type parameters are different: public actual typealias WeakReference<T> = WeakReference<T>" What it wants?
    m
    j
    4 replies
    Copy to Clipboard
  • Joey

    Joey

    2 years ago
    Im having this log when building my library in jitpack. Cant find any solutions online. Anyone encountered this?
    Joey
    1 replies
    Copy to Clipboard