Koin: Could not find org.koin:koin-core-jvm:3.0.0-alpha-4

Created on 14 Oct 2020  路  4Comments  路  Source: InsertKoinIO/koin

Describe the bug
I want to set up Koin as my DI library for my Kotlin Multiplatform project. After I add the dependencies I can't build the project and the error is Could not find org.koin:koin-core-jvm:3.0.0-alpha-4

Steps To Reproduce:

  1. Configure the project by following https://doc.insert-koin.io/#/setup/koin_mp
  2. Sync gradle
  3. Build project

Expected behavior
Ability to build the project and use Koin in shared, Android and iOS codebases.

Koin project used and used version: koin-core 3.0.0-alpha-4

Additional moduleDefinition
Here is my root build.gradle.kts buildscript

    repositories {
        gradlePluginPortal()
        jcenter()
        google()
        mavenCentral()

        maven(url = "https://dl.bintray.com/ekito/koin")
    }

And I added the dependency in commonMain sourceSets for the shared module I have
implementation("org.koin:koin-core:3.0.0-alpha-4")

While trying to build the project I get

Execution failed for task ':androidApp:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':androidApp:debugRuntimeClasspath'.
   > Could not find org.koin:koin-core-jvm:3.0.0-alpha-4.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://dl.google.com/dl/android/maven2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://jcenter.bintray.com/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://repo.maven.apache.org/maven2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
     Required by:
         project :androidApp > project :shared > org.koin:koin-core:3.0.0-alpha-4

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

It looks to me like the jvm version of the library is not released, and also I don't understand why my core library depends on the jvm library. Am I doing something wrong?

Most helpful comment

@azurh

You need to put maven(url = "https://dl.bintray.com/ekito/koin") in allProjects.repositories in the top level build.gradle.kts

buildscript {
    repositories {
        gradlePluginPortal()
        jcenter()
        google()
        mavenCentral()
    }

    dependencies {
        classpath(kotlin("gradle-plugin", Versions.kotlin))
        classpath(kotlin("serialization", Versions.kotlin))

        classpath("com.android.tools.build:gradle:4.1.0")
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()

        maven(url = "https://dl.bintray.com/ekito/koin")
    }
}

repositories {
    mavenCentral()
}

All 4 comments

The issue was on my side, but in my defense, the https://doc.insert-koin.io/#/setup/koin_mp could have this information written in it 馃槃

Long story short I added maven(url = "https://dl.bintray.com/ekito/koin") to buildscript.repositories but should've added it to allprojects.repositories.

Closing the issue.

I have this issue too.

@petarmarijanovicfive Where exactly did you add the custom maven repository?

I added maven(url = "https://dl.bintray.com/ekito/koin") in:

  • top level build.gradle.kts in buildscript.repositories and in repositories blocks
  • shared build.gradle.kts in the repositories block

I'm using the 3.0.0-alpha-4.

And still I get:

Execution failed for task ':tbellAndroid:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':tbellAndroid:debugRuntimeClasspath'.
   > Could not find org.koin:koin-core-jvm:3.0.0-alpha-4.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://dl.google.com/dl/android/maven2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://jcenter.bintray.com/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
       - https://repo.maven.apache.org/maven2/org/koin/koin-core-jvm/3.0.0-alpha-4/koin-core-jvm-3.0.0-alpha-4.pom
     Required by:
         project :tbellAndroid > project :shared > org.koin:koin-core:3.0.0-alpha-4

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

@azurh

You need to put maven(url = "https://dl.bintray.com/ekito/koin") in allProjects.repositories in the top level build.gradle.kts

buildscript {
    repositories {
        gradlePluginPortal()
        jcenter()
        google()
        mavenCentral()
    }

    dependencies {
        classpath(kotlin("gradle-plugin", Versions.kotlin))
        classpath(kotlin("serialization", Versions.kotlin))

        classpath("com.android.tools.build:gradle:4.1.0")
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()

        maven(url = "https://dl.bintray.com/ekito/koin")
    }
}

repositories {
    mavenCentral()
}

I've faced bizarre behavior.
If I add maven(url = "https://dl.bintray.com/ekito/koin") kmm's folders desappear (screenshots below)
What can be the cause of this behavior?

2021-01-26_184819
2021-01-26_184945

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miladsalimiiii picture miladsalimiiii  路  3Comments

haroldadmin picture haroldadmin  路  3Comments

sankarsana picture sankarsana  路  4Comments

ILAgent picture ILAgent  路  3Comments

dakuenjery picture dakuenjery  路  4Comments