์๋ฌ ๋ฐฐ๊ฒฝ
Execution failed for task ':domain:compileKotlin'.
> 'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
๋ฉํฐ๋ชจ๋ ๋์ ์ค domain๋ ์ด์ด๋ฅผ Java, Kotlin Library๋ก ๋ง๋ค์๋๋ฐ compileJava์ compileKotlin์ ๋ฒ์ ์ฐจ์ด๊ฐ ๋๋ค๋ ์ค๋ฅ๊ฐ ๋์๋ค.
์ฒ์์๋ domain์ ๋น๋ ํ์ผ์์ java๊ฐ 1_7๋ก ๋ผ์๊ธธ๋ 1_8๋ก ๋ฐ๊ฟ์คฌ๋๋ฐ๋ ์ ์ค๋ฅ๊ฐ ๊ณ์ ๋์๋ค.
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
๋ฌธ์ ๋ kotlin ์ชฝ์ด๋ค.
kotlinOptions {
jvmTarget = '1.8'
}
JDK 1.1๋ฒ์ ๋ถํฐ๋ 1.๋ฅผ ๋ถ์ด์ง์๊ณ ์๋ธ๋ฒ์ ํ์๋ฅผ ํ๋๋ฐ ์ ๋ฉ์์ง์ ๋ฐ๋ผ ํ์ฌ ๋ฒ์ ์ธ 17๋ก ๋ฐ๊ฟ์ฃผ๋ฉด ๋๋ค.
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
์ด๋ ๊ฒ ๋ชจ๋ ๋น๋ํ์ผ(build.gradle)์ ๋ฒ์ ์ ๋ค ๋ง์ถฐ ์ฃผ๋ ๋ฌด์ฌํ ๋น๋๊ฐ ๋๋ค.
๋ฉํฐ๋ชจ๋์ ์ด๋ค๋ฉด ๋๋ฉ์ธ ๋ชจ๋์์ ์ด๋ฐ ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์๋๋ฐ ๊ทธ๋๋ ๋ฒ์ ์ ๋ง์ถฐ์ฃผ๋ฉด ํด๊ฒฐ๋๋ ์ค๋ฅ๋ค.
"๋๊ธ, ๊ณต๊ฐ ๋ฒํผ ํ ๋ฒ์ฉ ๋๋ฅด๊ณ ๊ฐ์ฃผ์๋ฉด ํฐ ํ์ด ๋ฉ๋๋ค"
๋ฐ์ํ
'Android ๐ฅ๏ธ > ์ฝ์งโ๏ธ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Safe args ์ฌ์ฉํ๊ธฐ (0) | 2023.10.11 |
---|---|
Datastore ์ฌ์ฉํ๊ธฐ(Preferences DataStore) (0) | 2023.10.10 |
dialog์ background์์ฑ๊ฐ์ด ์ฝ๋์์ ์ ๋ ฅํ ๋ ์ ์ฉ๋๋ ์ด์ (0) | 2023.10.02 |
Progressbar ์ฌ์ฉํ๊ธฐ(feat. timer) (0) | 2023.10.02 |
Viewmodel ์ธ์คํด์ค ์ ์ ๋ฐฉ๋ฒ (0) | 2023.10.02 |