Thread
#multiplatform
    Davide Giuseppe Farella

    Davide Giuseppe Farella

    2 years ago
    I can’t understand why my jvm module (
    commandline
    ) cannot resolve dependencies from other multiplatform modules ( my source code only ) anymore.
    For example I got a
    domain
    like
    kotlin {
      jvm()
      js()
    
      sourceSets {
    
        val commonMain by getting {
        dependencies {
          api(`kotlin-common`)
          api(`coroutines-core-common`)
         }
        }
    
        val jvmMain by getting {
          dependencies {
            api(`kotlin-jdk8`)
            api(`coroutines-core`)
          }
        }
        
      }
    }
    and got
    commandline
    like
    kotlin {
    
      sourceSets {
    
        val main by getting {
        dependencies {
          implementation(project(":domain")
         }
        }
        
      }
    }
    But it can resolve all the dependencies exposed by
    api
    in domain ( kotlin, coroutines, koin, etc ), but cannot resolve from my sourceSet ( like
    my.project.domain.MyClass
    ) For some reason it was working before, I think it stopped to work after I added an android module ( which, differently from
    commainline
    , it’s working flawlessly ) #FYI: I got
    enableFeaturePreview("GRADLE_METADATA")
    russhwolf

    russhwolf

    2 years ago
    I’ve seen issues like this in the IDE but it still builds from command-line/gradle. eg https://youtrack.jetbrains.com/issue/KT-29082
    Davide Giuseppe Farella

    Davide Giuseppe Farella

    2 years ago
    Probably you are right 😄 Seem’s like AS removed this
    import kotlinx.coroutines.flow.collect
    during the commit, since he think’s in unused and that broke my CI 🙂 I’ll give the confim soon
    In fact, after I added the Android module, I started working on AS, instead of IntelliJ 😄 So that makes sense 🙂
    russhwolf

    russhwolf

    2 years ago
    Yeah. If the IDE is not resolving things, you can’t trust it with unused imports
    Davide Giuseppe Farella

    Davide Giuseppe Farella

    2 years ago
    Seems to be fine now 🙂 Thank you so much