Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Cannot import the dependency #50

Closed
avjiang opened this issue Jun 20, 2019 · 1 comment
Closed

Cannot import the dependency #50

avjiang opened this issue Jun 20, 2019 · 1 comment

Comments

@avjiang
Copy link

avjiang commented Jun 20, 2019

Hi, i am new to the Kotlin Multiplatform, and found this amazing library.

I am having problem to import the dependency into my common.kt file

here is my build.gradle file

def klockVersion = "1.4.0"

repositories {
   jcenter()
}

kotlin {
  targets {
    final def iOSTarget = presets.iosArm64

    fromPreset(iOSTarget, 'iOS') {
        binaries {
            framework('SharedCode')
        }
    }

    fromPreset(presets.jvm, 'android')
}

sourceSets {
    commonMain {
        dependencies {
            api 'org.jetbrains.kotlin:kotlin-stdlib-common'
            implementation 'com.soywiz.korlibs.klock:klock:1.4.0'
        }
    }

    androidMain.dependencies {
        api 'org.jetbrains.kotlin:kotlin-stdlib'
    }
  }
}

in my common.kt

import com. // unresolved reference

Can anyone guide me on this issue please ?
Any guide given much appreciated. Thanks

@andylamax
Copy link

Do as below

sourceSets {
    commonMain {
        dependencies {
            api 'org.jetbrains.kotlin:kotlin-stdlib-common'
            implementation 'com.soywiz.korlibs.klock:klock-metadata:1.4.0' // instead of implementation 'com.soywiz.korlibs.klock:klock:1.4.0'
        }
    }

    androidMain.dependencies {
        api 'org.jetbrains.kotlin:kotlin-stdlib'
        implementation 'com.soywiz.korlibs.klock:klock-android:1.4.0' //add this line here
    }
  }
}

@soywiz soywiz closed this as completed Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants