Open maciogg opened 1 week ago
But java target should be set in your project. The mentioned settings are not from the library
Have config
gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
settings.gradle id "com.android.application" version '8.3.0' apply false id "org.jetbrains.kotlin.android" version "2.0.21" apply false
build.gradle (app) compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 coreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = "17"
}
On other project with:
gradle-7.5-all.zip and id "com.android.application" version "7.3.0" apply false
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
working fine
Any update?
With gradle-7.5-all.zip and id "com.android.application" version "7.3.0" apply false
and
compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 coreLibraryDesugaringEnabled = true
}
kotlinOptions { jvmTarget = "17" }
it also works
For me, this worked when i added the following to the android/build.gradle file inside the allprojects block:
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (project.name == "p24_sdk") {
namespace project.group
def javaVersion = JavaVersion.VERSION_1_8
project.android.compileOptions {
sourceCompatibility javaVersion
sourceCompatibility javaVersion
}
project.android.kotlinOptions {
jvmTarget = javaVersion.toString()
}
}
}
}
}
}
For me, this worked when i added the following to the android/build.gradle file inside the allprojects block:
subprojects { afterEvaluate { project -> if (project.hasProperty('android')) { project.android { if (project.name == "p24_sdk") { namespace project.group def javaVersion = JavaVersion.VERSION_1_8 project.android.compileOptions { sourceCompatibility javaVersion sourceCompatibility javaVersion } project.android.kotlinOptions { jvmTarget = javaVersion.toString() } } } } } }
Dzięki :)
Have error
'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.