농장/Java·Kotlin

[IntelliJ / Kotlin] kotlinx.coroutines 모듈 Import 안됨 해결

귤발자 2023. 12. 10. 14:41
728x90
반응형

Unresolved reference: delay

 

우선 해당 패키지의 공식 경로는 아래와 같다.

https://github.com/Kotlin/kotlinx.coroutines#gradle

 

GitHub - Kotlin/kotlinx.coroutines: Library support for Kotlin coroutines

Library support for Kotlin coroutines . Contribute to Kotlin/kotlinx.coroutines development by creating an account on GitHub.

github.com

 

아래는 intelliJ에서 새 프로젝트 생성시 선택할 수 있는 빌드 시스템 별 해결방법이다.

 

Gradle

dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
}
repositories {
    mavenCentral() // 해당 코드도 있어야 한다고 한다.
}

 

Maven

<dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>kotlinx-coroutines-core</artifactId>
    <version>1.7.3</version>
</dependency>

 

IntelliJ

참고 : https://stackoverflow.com/a/74189275

 

Integrate Kotlinx coroutines in intelliJ project

I‘m using intellij for a while now. There I work on a javaFx project, which is mainly written in java but I discovered Kotlin to be a nice alternative. Recently I read about coroutines in Kotlin ...

stackoverflow.com

 


 

javax.coroutines 패키지 버전 참고: https://github.com/Kotlin/kotlinx.coroutines/releases

적용이 되지 않는다면 코틀린 버전을 최신으로 변경하거나 호환성을 확인해보자.

728x90
반응형