https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
q

qlitzler

01/09/2019, 1:37 PM
I have two android library modules called
androidMain
and
helper
. I'd like for
helper
to have a dependency on
androidMain
, but I can't figure out how to make the usual
implementation project(':main')
work. I keep geeting this error:
roject with path ':main' could not be found in root project 'instantsearch-kotlin'.
I've read this paragraph on the website but that didn't really help. https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#disambiguating-targets. Any help would be greatly appreciated !
d

dany

01/09/2019, 2:30 PM
how is main set in your settings.gradle(.kts) ?
😄 1
q

qlitzler

01/09/2019, 2:32 PM
Copy code
pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "kotlin-multiplatform") {
                useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
            }
        }
    }

    repositories {
        maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }

        mavenCentral()

        maven { url '<https://plugins.gradle.org/m2/>' }
    }
}
rootProject.name = 'instantsearch-kotlin'

enableFeaturePreview('GRADLE_METADATA')
It is the default settings.gradle when you start a new mpp shared platform library project.
d

Dico

01/09/2019, 3:37 PM
I've tried this as well before and failed