这是怎么回事呢?Windows上可以,Linux上就不行了
-
Exception in thread "Thread-12" java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:232) at java.util.ServiceLoader.access$100(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:270) at net.mamoe.mirai.Mirai.findMiraiInstance(IMirai.kt:357) at net.mamoe.mirai._MiraiInstance.get(IMirai.kt:351) at net.mamoe.mirai.Mirai.getInstance(IMirai.kt:41) at net.mamoe.mirai.BotFactory$INSTANCE.newBot(BotFactory.kt:115) at com.zhang.game.adm.daemons.QQbot.<init>(QQbot.java:107) at com.zhang.game.adm.daemons.QQbot.getInstance(QQbot.java:80) at com.zhang.game.adm.GameServer$3.run(GameServer.java:439) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoSuchMethodError: net.mamoe.mirai.utils.ServicesKt.loadServices(Lkotlin/reflect/KClass;)Lkotlin/sequences/Sequence; at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacadeImpl.<init>(MessageProtocolFacade.kt:194) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade$INSTANCE.<init>(MessageProtocolFacade.kt:162) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade$INSTANCE.<clinit>(MessageProtocolFacade.kt) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade.<clinit>(MessageProtocolFacade.kt) at net.mamoe.mirai.internal.MiraiImplKt._MiraiImpl_static_init(MiraiImpl.kt:25) at net.mamoe.mirai.internal.MiraiImpl.<clinit>(MiraiImpl.kt:94) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 11 more
-
文件不全。或者版本不一致
-
@cssxsh
不应该啊,完全一样的,换个环境就不行了 -
你这是什么环境(
如果是 native 的话要先注册 https://github.com/mamoe/mirai/blob/dev/mirai-core/src/nativeMain/kotlin/MiraiImpl.kt#L18 -
@Nambers
mirai-core-jvm
2.13.2
Linux