Gradle doesn't look for dependency in the right way

Viewed 1134
3 Answers

If someone else is facing a similar problem (with missing your-library-name-samplessources.jar) Usually, this is happening when your multiplatform project tries to consume the library, which doesn't support all the targets you have declared in your project. For example, you have an ios() target, while the library doesn't produce any native artifact. To understand which targets of your projects are not covered by the library, you could try to build your project by calling

./gradlew build  

You will receive a comprehensive error, describing which library variant wasn't found (ios_x64 in my case): enter image description here

I solved deleting jvm target from gradle, looks like moko library not support jvm yet.

versions: kotlin 1.4.21 moko-mvvm-*: 0.9.1

If you started getting this only recently, you might need to explicitly configure Android library variants for publishing:

kotlin {
    android {
        publishLibraryVariants("debug", "release")
    }
    ...
}

or

kotlin {
    android {
        publishAllLibraryVariants()
    }
    ...
}
Related