unable to import dependencies in kotlin multiplatform project - kotlin

Intellij Version: 2019.3
I am new to Kotlin-native development and would greatly appreciate any help I get. I created a Kotlin native/gradle project and I added the okhttp dependency to the project and I did not run into any issues in doing so.
But I am not able to import the okhttp library into the source. I keep getting "Unresolved reference: okhttp".

Related

Intellij-idea Debugger - Coroutine tab : "An error occurred on fetching information"

I'm trying to do some coroutine example represented on : https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-basic-02.kt
and It's debugger not working properly.
As you see, even code about coroutine like 'runBlocking' or 'launch' is not detected by intellisense,
I don't know what is my problem.
First my project is kotlin Console program, and
What I've done to import kotlinx.coroutine to my project are :
at Project Structure, Module downloaded org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC from Maven, when downloading checked Trasitive-something and Source, and added at library.
at Settings -> Build -> Kotlin compiler, changed language version and API version to 1.5, which is experimental version of Kotlin
at Project tool and build.gradle.kts, added
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0-RC") at dependencies,
kotlin("jvm") version "1.5.0" at plugins
Just run projects works well, but I can't use any context menu when using code about coroutine and as you know, it's really annoying me. any help would be appreciated.
I had the same problem but it seems to be fixed in 1.5.0. See https://youtrack.jetbrains.com/issue/KTIJ-11620
I meet this problem today, I use the latest the Coroutine library version and my kotlin version is 1.6.21 which is not the latest.
I just update my kotlin version to the latest version 1.8.10.

Unresolved reference for composite builds in Kotlin Multiplatform

I have a KMP project with dependencies to 3 other KMP library projects. I am adding them as dependencies in the build.gradle to sourceSets -> commonMain -> dependencies like this( after adding the path to the settings.gradle with includeBuild):
implementation "net.test:libraryA"
implementation "net.test:libraryB"
implementation "net.test:libraryC"
Until Kotlin 1.4 i didn't have any problem with this approach. With 1.4 the project is still building but the imports of the dependencies after the first one (libraryB and libraryC in this case) are always showing Unresolved reference errors in the IntelliJ. So basically any local KMP library that i add as a dependency after the first one is showing the same error.
I updated the Kotlin version to 1.4.10 and the Gradle version to 6.3 also I tried invalidate caches/restart with the IDE ( IntelliJ 2020.2.3 Community Edition) but still having the same issues. Does anyone have any idea what the problem might be?
Thanks

Insert TornadoFx in Kotlin project

I'm having some trouble on putting tornadoFx in my project. I'm using the last version of IntellIj, Kotlin and I'm also downloading tornadoFx from here:
TornadoFxGitLink
I added the pom file to Maven and I already tried to change a few things that Readme of tornado recommended to me like use 1.1 kotlin version or updating IDE.
The thing is that when I create a TornadoFx file in the project and I try to build, these error appears:
import tornado.fx is apparently an unresolved reference
Can someone explain why is this happening or why these errors normally appear?
Thanks in advance, I'm open to all questions due to my bad english.
That import is not needed or at all pointing to anything TornadoFX related. The only import you need for the most part is import tornadofx.*.
Install the TornadoFX IDEA plugin, and it will add the import for you. You should also start be reading the guide.
You should not be downloading TornadoFX manually, use Maven or Gradle to import the dependencies.
I recommend trying out TornadoFX in a simple standalone project first, for example by creating a template project using the TornadoFX IDEA Plugin. After you understand the basics you can revisit integrating it into an existing application.

Gradle project not getting imported in IntelliJ

I have installed IntelliJ and trying to import a gradle project but facing this error... Please Help me out
Java is 1.8 version
Gradle is not getting configured

Intellij: Gradle dependency not found

How would I solve this problem where the dependency can't be found? I have the library on my PC, I just don't know how to import it into my project.
Thanks!