I’m trying to add dependencies to a K/N project fo...
# kotlin-native
r
I’m trying to add dependencies to a K/N project for the first time. In my build file I have the following structure:
Copy code
kotlin {
    linuxArm32Hfp("projectname") {
        […]
    }

    sourceSets {
        projectnameMain {
            dependencies {
                implementation 'com.example.package:artifact-name:0.0.0'
            }
        }
    }
}
The string passed to
implementation
is highlighted in IntelliJ with this warning:
‘implementation’ cannot be applied to ‘(java.lang.String)’
Where do I put dependencies and how do I format them?
d
Ignore that error. The IDE is just being silly. As long as gradle sync passes, you're good to go.
r
As of when I posted that, it was syncing gradle but the library I was importing wasn’t showing up in my project at all. Now I’m seeing an error when I try to sync that gradle file. This may be because I am trying to add coroutines, which is not well supported yet?
Could not resolve org.jetbrains.kotlinxkotlinx coroutines core native1.3.5.
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
(And
jcenter()
is already declared in the repos.)
d
Which version of things are you using?
r
My multiplatform plugin:
id ‘org.jetbrains.kotlin.multiplatform’ version ‘1.3.71’
I think that’s the only version number in my configuration… Not using any other dependencies right now
d
Gradle version?
Nvm. I know what is wrong.
linuxArm32Hfp
is not supported yet.
(By
kotlinx.coroutines
that is)
r
Good to know! Would that be causing the repo error and other errors I see on gradle sync? Or would that issue only arise at build?
d
I'm not completely sure. It should explain it all.
r
Thank you