Coder Social home page Coder Social logo

Comments (9)

phoenixsky avatar phoenixsky commented on May 27, 2024 1

试试这个版本:1.8.20-1.0.2-beta01-jdk11 打包记录:https://jitpack.io/#JailedBird/ArouterKspCompiler/1.8.20-1.0.2-beta01-jdk11

试了下不行,就知道不是这个插件的问题了,我使用room的ksp也会出现这个问题。sorry。。。。
目前我把所有module都加了限制:

    tasks.withType(KotlinCompile::class.java) {
        kotlinOptions {
            jvmTarget = JavaVersion.VERSION_11.toString()
        }
    }
    java {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }

这样就可以了,辛苦你了

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

我不是很懂Java11和Java8的兼容性问题,插件里面使用的 sourceCompatibility = JavaVersion.VERSION_1_8, demo(app模块)使用的是JDK11的gradle去运行的,没发现问题;

你看看这篇stackoverflow?看看能不能解答疑惑👀
https://stackoverflow.com/questions/69079963/how-to-set-compilejava-task-11-and-compilekotlin-task-1-8-jvm-target-com

from arouterkspcompiler.

phoenixsky avatar phoenixsky commented on May 27, 2024

image
如上图是警告,并不是错误。
原因是,我项目里java的版本指定的是11,个别模块依赖了这个arouter的ksp,可能你项目里指定的是1.8
就有了上图的提示,我试图覆盖你指定的1.8但是没生效。

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

我在这个分支,app模块配置jdk11, 导入jdk8的jitpack 远端依赖,没报这个warning🤣
https://github.com/JailedBird/ArouterKspCompiler/tree/test-jdk11-build-warning
我再看看warning信息吧

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

复现了类似的问题😂,如下图:

image

你检查下对应那个模块,compileOptions 和 kotlinOptions 的版本号是不是不一致?
PS: 初步测试不一致会出现你的那个问题,一致(均为11)就不会

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '11'
    }

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

还不行,你就说下Kotlin版本吧,我打一个Java11 的版本,你试试🤣

from arouterkspcompiler.

phoenixsky avatar phoenixsky commented on May 27, 2024

"1.8.20-1.0.2"这个版本 搞个java11的吧。我试试

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

试试这个版本:1.8.20-1.0.2-beta01-jdk11
打包记录:https://jitpack.io/#JailedBird/ArouterKspCompiler/1.8.20-1.0.2-beta01-jdk11

from arouterkspcompiler.

JailedBird avatar JailedBird commented on May 27, 2024

上述Kotlin高版本问题,均可参考如上方案:

https://stackoverflow.com/questions/69079963/how-to-set-compilejava-task-11-and-compilekotlin-task-1-8-jvm-target-com

from arouterkspcompiler.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.