在mirai更新2.12.0之前一切都挺好的,可能是2.12.0使用了协程的问题,一监听就报下面的错误:
java.util.NoSuchElementException: Could not find an implementation for service class net.mamoe.mirai.event.InternalGlobalEventChannelProvider at net.mamoe.mirai.utils.ActualsKt.loadService(Actuals.kt:40) ~[?:?] at net.mamoe.mirai.utils.ActualsKt.loadService$default(Actuals.kt:35) ~[?:?] at net.mamoe.mirai.event.GlobalEventChannel$instance$2.invoke(GlobalEventChannel.kt:31) ~[?:?] at net.mamoe.mirai.event.GlobalEventChannel$instance$2.invoke(GlobalEventChannel.kt:30) ~[?:?] at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[?:?] at net.mamoe.mirai.event.GlobalEventChannel.getInstance(GlobalEventChannel.kt:30) ~[?:?] at net.mamoe.mirai.event.GlobalEventChannel.createListener(GlobalEventChannel.kt:44) ~[?:?] at net.mamoe.mirai.event.EventChannel.subscribeAlways(EventChannel.kt:630) ~[?:?] at net.mamoe.mirai.event.EventChannel.subscribeAlways$default(EventChannel.kt:622) ~[?:?] at net.mamoe.mirai.event.EventChannel.subscribeAlways(EventChannel.kt) ~[?:?] at me.dreamvoid.miraimc.bukkit.MiraiEvent.startListenEvent(MiraiEvent.java:103) ~[?:?] (省略别的不重要的trace)相同的代码和环境换成2.11.1无此问题。
看过文档,没看出有什么问题,故在此发问。