• Trevor Stone

    Trevor Stone

    3 years ago
    Hey! Has anyone else ran into an issue where multiplatform code is showing up as a missing import in Android Studio/IntelliJ, but the code still compiles and runs fine? I am trying to use it just as a jvm library but consumed inside of an android app. There are multiple kotlin multiplatform modules that are dependencies of each other as well. Everything seems to work fine except for the IDE integration
    Trevor Stone
    josephivie
    2 replies
    Copy to Clipboard
  • gumil

    gumil

    3 years ago
    Is using
    kotlin-platform-common
    already deprecated? should we just use the multiplatformplugin? I can’t find documentation on
    kotlin-platform-common
    gumil
    r
    +1
    4 replies
    Copy to Clipboard
  • Riccardo Montagnin

    Riccardo Montagnin

    3 years ago
    Hello everyone. Is it possible to run the tests inside
    commonTest
    without any
    jvm
    or other module? If I try to run
    gradle check
    I get the following error:
    > Task :compileKotlinJvm 
    
    e: ...: Unresolved reference: Json
    Where
    Json
    is imported as
    import kotlinx.serialization.json.Json
    And my dependencies are the following:
    kotlin.sourceSets {
        commonMain.dependencies {
            api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"
        }
    }
    Riccardo Montagnin
    s
    5 replies
    Copy to Clipboard
  • pajatopmr

    pajatopmr

    3 years ago
    I have not a clue what that means or how to resolve it. Any help?
    pajatopmr
    Dico
    +1
    6 replies
    Copy to Clipboard
  • m

    Marc Knaup

    3 years ago
    multiple failures 😅
    m
    russhwolf
    2 replies
    Copy to Clipboard
  • b

    basher

    3 years ago
    I have a sealed class, and as soon as I made it internal, I got these warnings when linking the test executable that tests the inline functions of that class:
    warning: inliner failed to obtain function declaration: <package>.<class>.<function>
    Has anyone run into this before?
    b
    russhwolf
    3 replies
    Copy to Clipboard
  • j

    jw

    3 years ago
    Did you try JvmName?
    j
    1 replies
    Copy to Clipboard
  • p

    Patrick Jackson

    3 years ago
    Are top level variables initialized differently in kotlin native? I have code that runs on jvm fine, but in native I get a bad_access for a val. Given: class A(private var b: B) { fun foo() { b.bar() } } val b = B() val a = A(b) I will get a bad_access (null pointer) on the instance of b when calling b.bar() in foo(). Changing a to use
    by lazy
    fixes the problem.
    p
    olonho
    4 replies
    Copy to Clipboard
  • pajatopmr

    pajatopmr

    3 years ago
    How do test resources get moved such that they will be accessible via
    classLoader.getResource("foo.txt")
    during a test? And is the package relevant?
    pajatopmr
    Kris Wong
    +1
    13 replies
    Copy to Clipboard
  • i

    ivan.savytskyi

    3 years ago
    Hey folks, how to provide
    linkerOpts
    for compilation tests? in MPP project (MPP gradle plugin) If I do this:
    def iosPreset = findProperty("kn.ios.target") == "arm" ? presets.iosArm64 : presets.iosX64
            fromPreset(iosPreset, 'ios') {
                compilations.all {
                    kotlinOptions.freeCompilerArgs = ["-Xverbose-phases=linker"]
                    outputKinds('FRAMEWORK')
                    linkerOpts "-F./libs"
    I’m getting error
    llvm-lto: error: Linking globals named 'ktype:com.greeter.NSObjectProtocolMeta': symbol multiply defined!
    Is there any way I can provide
    linkerOpts
    for test compilation
    i
    2 replies
    Copy to Clipboard