kotlin NoSuchMethodError
-
Exception in thread "main" java.lang.NoSuchMethodError: kotlin/text/CharsKt.digitToInt(CI)I (loaded from file:/E:/mavenlocal/repository/org/jetbrains/kotlin/kotlin-stdlib/1.4.21/kotlin-stdlib-1.4.21.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@8f7295d8) called from class net.mamoe.mirai.utils.MiraiUtils__ConversionsKt (loaded from file:/E:/mavenlocal/repository/net/mamoe/mirai-core-utils-jvm/2.7.1-dev-1/mirai-core-utils-jvm-2.7.1-dev-1.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@8f7295d8). at net.mamoe.mirai.utils.MiraiUtils__ConversionsKt.parseFromHexChunk(Conversions.kt:167) at net.mamoe.mirai.utils.MiraiUtils.parseFromHexChunk(Unknown Source) at net.mamoe.mirai.utils.MiraiUtils__ConversionsKt.hexToBytes(Conversions.kt:153) at net.mamoe.mirai.utils.MiraiUtils.hexToBytes(Unknown Source) at net.mamoe.mirai.internal.utils.crypto.ECDHKt.<clinit>(ECDH.kt:133) at net.mamoe.mirai.internal.network.components.AccountSecretsManagerKt.AccountSecretsImpl(AccountSecretsManager.kt:146) at net.mamoe.mirai.internal.network.components.AccountSecretsManagerKt.getSecretsOrCreate(AccountSecretsManager.kt:154) at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.createClient(BotClientHolder.kt:36) at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.access$createClient(BotClientHolder.kt:24) at net.mamoe.mirai.internal.network.components.BotClientHolderImpl$client$2.invoke(BotClientHolder.kt:28) at net.mamoe.mirai.internal.network.components.BotClientHolderImpl$client$2.invoke(BotClientHolder.kt:28) at net.mamoe.mirai.utils.LateinitMutableProperty.getValue(LateinitMutableProperty.kt:38) at net.mamoe.mirai.internal.network.components.BotClientHolderImpl.getClient(BotClientHolder.kt:28) at net.mamoe.mirai.internal.network.components.SsoProcessorImpl.getClient(SsoProcessor.kt:97) at net.mamoe.mirai.internal.network.components.SsoProcessorImpl.logout(SsoProcessor.kt:138) at net.mamoe.mirai.internal.QQAndroidBot$close$1.invokeSuspend(QQAndroidBot.kt:70) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at net.mamoe.mirai.internal.QQAndroidBot.close(QQAndroidBot.kt:68) at net.mamoe.mirai.internal.AbstractBot.login(AbstractBot.kt:126) at net.mamoe.mirai.Bot$login$1.invoke(Bot.kt:65535) at net.mamoe.mirai.Bot$login$1.invoke(Bot.kt) at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:205) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115) at net.mamoe.kjbb.internal.RunBlockingKt.$runSuspend$(RunBlocking.kt:18) at net.mamoe.mirai.Bot.login(Bot.kt) at tech.xysu.xyhc.qrobot.QRobot.main(QRobot.java:50)
jdk版本11 以前可以正常编译 miraicore更新2.7后报方法找不到
友友们在线求救 -
更新kotlin 1.5.*看看
-
@nambers 1.5.10 1.5.30都试了没得用
-
@xbigriceh 报错有吗? 是一样的?
去看了下那个方法好像是since 1.5
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/digit-to-int.html -
是的 一样的
-
此回复已被删除! -
@xbigriceh 之前使用2.6.8没报过错 升2.7就开始了
-
@xbigriceh 新的报错里面的kt的包路径也是1.5? 那很奇怪我本地用1.5.10然后编译运行都没什么问题,如果确保是1.5那去mirai那开个issue吧
-
@nambers 草你这么一说好像报错里的路径是1.4a 但是我pom.xml配的是1.5emm
我研究研究怎么改 -
@xbigriceh
可以在左侧project下面的external library看在哪个(子)项目是1.4(如果ide是idea的话)
然后可以sync gradle看看
或者有方法强制指定版本(就是覆盖其他地方的设置) -
不理解 资源里kotlin下属的coroutines stdlib之类的全都是1.4 但是我主引用kotlin-stdlib-jdk8是1.5
-
在pom手动替换了这几项 跑起来了
<dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib-jdk8</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.jetbrains.kotlinx</groupId> <artifactId>kotlinx-coroutines-core</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.jetbrains.kotlinx</groupId> <artifactId>kotlinx-coroutines-core-jvm</artifactId> <version>1.5.0</version> </dependency>
谢谢巨佬