Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':p24_sdk:compileDebugKotlin'. #22

Open
maciogg opened this issue Nov 14, 2024 · 6 comments
Open

Execution failed for task ':p24_sdk:compileDebugKotlin'. #22

maciogg opened this issue Nov 14, 2024 · 6 comments

Comments

@maciogg
Copy link

maciogg commented Nov 14, 2024

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.

@mareklat
Copy link
Collaborator

But java target should be set in your project. The mentioned settings are not from the library

@maciogg
Copy link
Author

maciogg commented Nov 14, 2024

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

@maciogg
Copy link
Author

maciogg commented Nov 18, 2024

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

@radeckid
Copy link

radeckid commented Nov 20, 2024

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()
                        }
                    }
                }
            }
        }
    }

@maciogg
Copy link
Author

maciogg commented Nov 20, 2024

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 :)

@przelewy24mobile
Copy link
Collaborator

New version 1.0.60 released. Please check if it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants