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

[BUG] Build Failure: Mismatched Java and Kotlin JVM Target Compatibility in qr_code_scanner #755

Open
sanjay-dreamcast opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@sanjay-dreamcast
Copy link

Execution failed for task ':qr_code_scanner:compileDebugKotlin'.

'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.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

Using Below Gradle version
distributionUrl=https://services.gradle.org/distributions/gradle-8.3-all.zip

@sanjay-dreamcast sanjay-dreamcast added the bug Something isn't working label Jan 9, 2025
@lillogoal
Copy link

lillogoal commented Jan 9, 2025

Try this:
in build.gradle in the root of project inside allProjects insert these:

subprojects {
        afterEvaluate { project ->
            if (project.hasProperty('android')) {
                project.android {
                    if (namespace == null) {
                        namespace project.group
                    }
                }
            }
            if (project.hasProperty("android")) {
                project.android {
                    compileOptions {
                        sourceCompatibility JavaVersion.VERSION_17
                        targetCompatibility JavaVersion.VERSION_17
                    }
                }
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants