美文网首页
kaptGenerateStubsReleaseKotlin t

kaptGenerateStubsReleaseKotlin t

作者: 吉凶以情迁 | 来源:发表于2024-01-23 11:05 被阅读0次

    发现代码中没有17

        compileOptions {
            sourceCompatibility(JavaVersion.VERSION_11)
            targetCompatibility(JavaVersion.VERSION_11)
        }
    
        kotlinOptions {
            jvmTarget = "11"
        }
    
    
    image.png
    FAILURE: Build completed with 2 failures.
    
    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':base_extend:kaptGenerateStubsReleaseKotlin'.
    > 'compileReleaseJavaWithJavac' task (current target is 1.8) and 'kaptGenerateStubsReleaseKotlin' 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.
    ==============================================================================
    
    2: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':base:kaptGenerateStubsReleaseKotlin'.
    > 'compileReleaseJavaWithJavac' task (current target is 11) and 'kaptGenerateStubsReleaseKotlin' 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.
    ==============================================================================
    
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach{
    kotlinOptions{jvmTarget = "1.8"}
    }
    
    image.png
    
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs>().configureEach {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    

    全局

    image.png
    allprojects {
        tasks.withType<org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs>().configureEach {
            kotlinOptions {
                jvmTarget = JavaVersion.VERSION_1_8.toString()
            }
        }
    }
    

    https://kotlinlang.org/docs/gradle-configure-project.html?utm_campaign=gradle-jvm-toolchain&utm_medium=kgp&utm_source=warnings#other-details
    https://www.null123.com/question/detail-2720063.html
    https://www.saoniuhuo.com/question/detail-2492575.html

    相关文章

      网友评论

          本文标题:kaptGenerateStubsReleaseKotlin t

          本文链接:https://www.haomeiwen.com/subject/yjiuodtx.html