• louiscad

    louiscad

    3 years ago
    Hi, does anyone know how to tell the Android Gradle Plugin to use content and dependencies of the
    androidMain
    sourceSet from Kotlin multiplatform plugin in an
    androidTest
    sourceSet (instrumented test)? My
    build.gradle.kts
    includes the following:
    android {
        setDefaults()
        sourceSets.getByName("androidTest").java.srcDir("src/androidInstrumentedTest/kotlin") // I put my instrumented tests here.
    }
    kotlin {
        android()
        sourceSets {
            getByName("androidMain").dependencies {
                // Some dependencies here
            }
        }
    }
    dependencies {
        androidTestImplementation(Libs.kotlin.testJunit)
        androidTestImplementation(Libs.androidX.test.coreKtx)
        androidTestImplementation(Libs.androidX.test.ext.junit)
        androidTestImplementation(Libs.androidX.test.runner)
        androidTestImplementation(Libs.kotlinX.coroutines.android)
    }
    The problem I encounter is that it compiles, but when an instrumented test is run, there's
    NoClassDefFoundError
    on anything defined in
    androidMain
    (be it source or dependency). Note that the IDE shows no warning and allows me to use the dependencies from
    androidInstrumentedTest
    , but it fails at runtime.
    louiscad
    gildor
    2 replies
    Copy to Clipboard
  • c

    carlos cdmp

    3 years ago
    Any updated multiplatform project with Android, IOS, and web to check on github? I want to start a project, so i would like to have a nice example
    c
    olonho
    +2
    7 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    I’ve encountered an issue when using Coroutines in mpp. The Obj-C header errors on the following line:
    @property (class, readonly) CounterCoreCoroutineStart *default;
    p
    russhwolf
    +1
    7 replies
    Copy to Clipboard
  • j

    Jaroslav

    3 years ago
    Is there any easy way to debug
    kotlin.NotImplementedError: An operation is not implemented: Not implemented
    ? I`m using kotlin library in ios, with a lot of code, so it will take me a lot of time to find what exactly is not implemented 😞
    j
    m
    +1
    6 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    Hey, all. I’m getting a
    kotlin.TypeCastException
    that I’m hoping you all can help with. In order to get around generics and casting issues in K/N, I’ve quarantined a call to a generic function to the common Kotlin code in an mpp project: https://github.com/pardom/oolong/pull/16/files#diff-b6307a0524635d6d8940c58b27823806R48. This fixes the compiler errors in Swift, however it fails at runtime due to casting. Any ideas why?
    p
    olonho
    2 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    Also, do type aliases to functions not get exported to K/N? I can’t reference any in the consuming project.
    p
    olonho
    3 replies
    Copy to Clipboard
  • g

    GarouDan

    3 years ago
    Hi, it looks like we have a problem when integrating the
    kotlin("multiplatform")
    and spring boot. I’ve filed an issue about that here: https://youtrack.jetbrains.com/issue/KT-30340 I was talking with the folks in the spring boot gitter chat and they said:
    but I would guess that, unlike, the JVM platform plugin, it doesn't apply Gradle's Java plugin
    If someone knows how to fix this please tell me 😃
    g
    bdeg
    4 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    Is there any documentation on K\N generic function interop? There’s nothing in here https://github.com/JetBrains/kotlin-native/blob/master/OBJC_INTEROP.md#function-types
    p
    s
    +1
    6 replies
    Copy to Clipboard
  • a

    Andrey Gromov

    3 years ago
    Hello! I create new multiplatform prject (android/ios) by Idea wizard. After that I add Ktor, step by step from manual. For android and common part all is ok, but iosMain does not see "import kotlinx.coroutines.*" at all. How to add ktor/coroutines to iosMain correctly?RESOLVED Inserting
    enableFeaturePreview("GRADLE_METADATA")
    into settings.gradle resolve problem. 7 f**g hours dancing with tambourine...
    a
    1 replies
    Copy to Clipboard
  • p

    pardom

    3 years ago
    Does someone have an example of packaging a
    js
    target for npm? I thought I saw one somewhere but I don’t remember where.
    p
    2 replies
    Copy to Clipboard