๋ฐ๋จ...
Jetpack Compose Navigation์ ํ๊ณ ์ถ์์ต๋๋ค.
๊ทธ๋์ app๋จ build.gradle์ ์๋์ ์ฝ๋๋ฅผ ์ ๋ ฅํด์ฃผ๊ณ ๋น๋ํด์ฃผ์์ต๋๋ค.
implementation "androidx.navigation:navigation-compose:2.6.0"
๊ทธ๋ฌ๋๋ ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ์ต๋๋ค.
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.io.path.DirectoryEntriesReader found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.ExperimentalPathApi found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.FileVisitorBuilder found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.FileVisitorBuilderImpl found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.FileVisitorImpl found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.LinkFollowing found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathNode found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathRelativizer found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathTreeWalk found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathTreeWalk$bfsIterator$1 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathTreeWalk$dfsIterator$1 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathTreeWalkKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathWalkOption found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathsKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathsKt__PathReadWriteKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.io.path.PathsKt__PathUtilsKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.jdk7.AutoCloseableKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk7-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20)
Duplicate class kotlin.jvm.jdk8.JvmRepeatableKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.jvm.optionals.OptionalsKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.random.jdk8.PlatformThreadLocalRandom found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.streams.jdk8.StreamsKt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$1 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$2 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$3 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.streams.jdk8.StreamsKt$asSequence$$inlined$Sequence$4 found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.text.jdk8.RegexExtensionsJDK8Kt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
Duplicate class kotlin.time.jdk8.DurationConversionsJDK8Kt found in modules kotlin-stdlib-1.8.20 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20) and kotlin-stdlib-jdk8-1.7.20 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20)
์ ์๋ฌ๋ Kotlin ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ด๋ จ๋ ์ค๋ณต ํด๋์ค์ ๋ํ ๋ฌธ์ ๋ฅผ ๋ํ๋ ๋๋ค. Kotlin ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ Kotlin JDK8 ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฐ์ ์ค๋ณต๋ ํด๋์ค๊ฐ ๋ฐ๊ฒฌ๋์ด ์ถฉ๋์ด ๋ฐ์ํ ๊ฒ์ผ๋ก ๋ณด์ธ๋ค๋ ๊ฒ์ ๋๋ค.
์ฆ, ํ๋ก์ ํธ์์ kotlin ๋ฒ์ ๊ณผ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฒ์ ์ด ์๋ก ์ถฉ๋ํ๊ณ ์๋ค๋ ์๋ฌ์์ต๋๋ค.
๊ทธ๋์ project ๋จ์ build.gradle์ kotlin ๋ฒ์ ์ ์์ ํด์ฃผ์์ต๋๋ค.
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
์ ๋ ์์ ๋ฒ์ ์ผ๋ก ์์ ํด์ฃผ์๋๋ฐ,
์ต์ ๋ฒ์ ์ ์๋ ๋งํฌ์์ ํ์ธํ ์ ์์ต๋๋ค.
https://kotlinlang.org/docs/releases.html#release-details
๊ทธ๋ฐ๋ฐ ์ ๋ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ ๋ฐ์ํ์์ต๋๋ค..
Execution failed for task ':data:kaptGenerateStubsDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'kaptGenerateStubsDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
์์ ์๋ฌ๋ ๋ ๊ฐ์ง ์์ ์ธ 'compileDebugJavaWithJavac' ์์ ๊ณผ 'kaptGenerateStubsDebugKotlin' ์์ ์ด ์๋ก ๋ค๋ฅธ Java ๋ฒ์ ์ ๋์์ผ๋ก ํ๊ณ ์์ด์ ๋ฐ์ํ๋ ๋ฌธ์ ๋ฅผ ๋ํ๋ ๋๋ค.
์ผ๋ฐ์ ์ผ๋ก ์๋๋ก์ด๋ ํ๋ก์ ํธ์์๋ ๋ชจ๋ ์์ ์ด ๋์ผํ Java ๋ฒ์ ์ ๋์์ผ๋ก ์ค์ ๋์ด์ผ ํฉ๋๋ค.
๊ทธ๋ฌ๋ ํด๋น ์๋ฌ๋ 'compileDebugJavaWithJavac' ์์ ์ด Java ๋ฒ์ 1.8์ ๋์์ผ๋ก ํ๊ณ ์๊ณ , 'kaptGenerateStubsDebugKotlin' ์์ ์ Java ๋ฒ์ 17์ ๋์์ผ๋ก ํ๊ณ ์๋ค๋ ๊ฒ์ ์๋ฏธํฉ๋๋ค.
์ ๋ 17๋ฒ์ ์ผ๋ก ์ค์ ๋์ด ์๋ ๊ฑธ ํ์ธํ๊ณ
app๋จ์ build.gradle์ ์ฝํ๋ฆฐ ์ปดํ์ผ ์ต์ ์ ์์ ํด์ฃผ์์ต๋๋ค.
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
์ ์ฝ๋๊ฐ sourceCompatibility์ targetCompatibility์ธ์ง ํ์ธํด์ผ ํฉ๋๋ค,,
๊ทธ๋ฌ๋๋ ์๋์ ๊ฐ์ ์๋ฌ๋ ๋ฐ์ํ์์ต๋๋ค.
This version (1.4.8) of the Compose Compiler requires Kotlin version 1.8.22 but you appear to be using Kotlin version 1.8.20 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin to choose a compatible version pair (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
์ ์๋ฌ๋ ์ปดํฌ์ฆ ๋ฒ์ ๊ณผ ์ฝํ๋ฆฐ ๋ฒ์ ์ด ์๋ก ํธํํ๋ ๋ฒ์ ์ด ์๋ ๊ฒฝ์ฐ์ ๋ฐ์ํ๋ ์๋ฌ์ ๋๋ค.
ํธํํ๋ ๋ฒ์ ์ ์๋์ ๋งํฌ์์ ํ์ธํ ์ ์์ต๋๋ค.
https://developer.android.com/jetpack/androidx/releases/compose-kotlin
๊ทธ๋ ๊ฒ ํด์ ๋น๋๊ฐ ์ฑ๊ณตํ์์ต๋๋ค !
๋ฒ์ ์ด ๋ง์ง ์์ ๋ ์ ๋ง ๋ค์ํ ์๋ฌ๊ฐ ๋์ฌ ์ ์๋ค๋ ๊ฑธ ์ ์ ์์๋ ๊ฒฝํ์ด์์ต๋๋ค... ๐ฅฒ