gpt4 book ai didi

java - 冲突的 jetified-kotlin-reflect 依赖

转载 作者:太空宇宙 更新时间:2023-11-03 12:26:12 24 4
gpt4 key购买 nike

当我构建我的 Android 项目时,我收到以下消息:

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/janek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.10/4d147bf43060dc43d61b096e24da1e67dfe0c032/kotlin-stdlib-jdk7-1.3.10.jar (version 1.3)
/home/janek/.gradle/caches/transforms-1/files-1.1/kotlin-reflect-1.0.6.jar/beba9d201a205f30041b70982540014d/jetified-kotlin-reflect-1.0.6.jar (version 1.0)
/home/janek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.11/4cbc5922a54376018307a731162ccaf3ef851a39/kotlin-stdlib-1.3.11.jar (version 1.3)
/home/janek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.11/d8b8e746e279f1c4f5e08bc14a96b82e6bb1de02/kotlin-stdlib-common-1.3.11.jar (version 1.3)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

但我不知道为什么 jetified-kotlin-reflect 甚至在那里,因为它不是依赖项,甚至没有出现在 androidDependencies 中。

您知道它从哪里来或者我该如何解决这个错误吗?

最佳答案

我想如果您使用 reflection features,kotlin 插件会自动添加 kotlin-relfection.jar类文字语法

On the Java platform, the runtime component required for using the reflection features is distributed as a separate JAR file (kotlin-reflect.jar). This is done to reduce the required size of the runtime library for applications that do not use reflection features. If you do use reflection, please make sure that the .jar file is added to the classpath of your project.

我通过显式添加修复了警告

implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

到我的 build.gradle。

关于java - 冲突的 jetified-kotlin-reflect 依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54307822/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com