已解决 IDEA中执行Run Mirai Console报错
-
尝试新建了空的工程,也会报错。
附上debug-sandbox目录下的日志内容:
2022-11-05 21:12:43 I/main: Starting mirai-console... 2022-11-05 21:12:44 I/main: ==================================[ Mirai consosle 2.13.0 ]=================================== __ __ __ __ ______ __ | \ / \ \ | \/ \ | \ | ▓▓\ / ▓▓\▓▓ ______ ______ \▓▓ ▓▓▓▓▓▓\ ______ _______ _______ ______ | ▓▓ ______ | ▓▓▓\ / ▓▓▓ \/ \ | \| \ ▓▓ \▓▓/ \| \ / \/ \| ▓▓/ \ | ▓▓▓▓\ ▓▓▓▓ ▓▓ ▓▓▓▓▓▓\ \▓▓▓▓▓▓\ ▓▓ ▓▓ | ▓▓▓▓▓▓\ ▓▓▓▓▓▓▓\ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓\ ▓▓ ▓▓▓▓▓▓\ | ▓▓\▓▓ ▓▓ ▓▓ ▓▓ ▓▓ \▓▓/ ▓▓ ▓▓ ▓▓ __| ▓▓ | ▓▓ ▓▓ | ▓▓\▓▓ \| ▓▓ | ▓▓ ▓▓ ▓▓ ▓▓ | ▓▓ \▓▓▓| ▓▓ ▓▓ ▓▓ | ▓▓▓▓▓▓▓ ▓▓ ▓▓__/ \ ▓▓__/ ▓▓ ▓▓ | ▓▓_\▓▓▓▓▓▓\ ▓▓__/ ▓▓ ▓▓ ▓▓▓▓▓▓▓▓ | ▓▓ \▓ | ▓▓ ▓▓ ▓▓ \▓▓ ▓▓ ▓▓\▓▓ ▓▓\▓▓ ▓▓ ▓▓ | ▓▓ ▓▓\▓▓ ▓▓ ▓▓\▓▓ \ \▓▓ \▓▓\▓▓\▓▓ \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓ \▓▓\▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓ \▓▓▓▓▓▓▓ 2022-11-05 21:12:44 I/main: Backend: version 2.13.0, built on 2022-11-01 10:47:11. 2022-11-05 21:12:44 I/main: Frontend Terminal: version 2.13.0, provided by Mamoe Technologies 2022-11-05 21:12:44 I/main: Welcome to visit https://mirai.mamoe.net/ 2022-11-05 21:12:44 W/MultiFilePluginDataStorageImpl: Could not save AutoLogin in YAML format due to exception in YAML encoder. Please report this exception and relevant configurations to https://github.com/mamoe/mirai/issues/new/choose java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813) at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729) at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403) at kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:272) at net.mamoe.mirai.utils.ServicesKt.loadService(Services.kt:18) at net.mamoe.mirai.Mirai.findMiraiInstance(IMirai.kt:357) at net.mamoe.mirai._MiraiInstance.get(IMirai.kt:348) at net.mamoe.mirai.Mirai.getInstance(IMirai.kt:39) at net.mamoe.mirai.internal.message.MessageSerializersImpl.getSerializersModule(MessageSerializersImpl.kt:65) at net.mamoe.mirai.message.MessageSerializers$INSTANCE.getSerializersModule(MessageSerializers.kt) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl$createYaml$1.invoke(MultiFilePluginDataStorageImpl.kt:114) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl$createYaml$1.invoke(MultiFilePluginDataStorageImpl.kt:112) at net.mamoe.yamlkt.YamlKt.Yaml(Yaml.kt:242) at net.mamoe.yamlkt.YamlKt.Yaml$default(Yaml.kt:240) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.createYaml(MultiFilePluginDataStorageImpl.kt:112) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.store(MultiFilePluginDataStorageImpl.kt:85) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.load(MultiFilePluginDataStorageImpl.kt:52) at net.mamoe.mirai.console.internal.data.builtins.ConsoleDataScopeImpl.addAndReloadConfig(ConsoleDataScopeImpl.kt:41) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:265) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:508) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54) Caused by: java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813) at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729) at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403) at kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:272) at net.mamoe.mirai.utils.ServicesKt.loadService(Services.kt:18) at net.mamoe.mirai.Mirai.findMiraiInstance(IMirai.kt:357) at net.mamoe.mirai._MiraiInstance.get(IMirai.kt:348) at net.mamoe.mirai.Mirai.getInstance(IMirai.kt:39) at net.mamoe.mirai.internal.message.MessageSerializersImpl.getSerializersModule(MessageSerializersImpl.kt:65) at net.mamoe.mirai.internal.message.MessageSerializersImpl.registerSerializers(MessageSerializersImpl.kt:76) at net.mamoe.mirai.message.MessageSerializers$INSTANCE.registerSerializers(MessageSerializers.kt) at net.mamoe.mirai.internal.message.protocol.MessageProtocolFacade.<clinit>(MessageProtocolFacade.kt:165) at net.mamoe.mirai.internal.MiraiImplKt._MiraiImpl_static_init(MiraiImpl.kt:25) at net.mamoe.mirai.internal.MiraiImpl.<clinit>(MiraiImpl.kt:87) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789) ... 22 more Caused by: java.lang.NoClassDefFoundError: net/mamoe/mirai/internal/deps/io/ktor/client/engine/okhttp/OkHttp at net.mamoe.mirai.internal.MiraiImplKt.createDefaultHttpClient(MiraiImpl.kt:29) at net.mamoe.mirai.internal.MiraiImpl.<init>(MiraiImpl.kt:97) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789) ... 41 more Caused by: java.lang.ClassNotFoundException: net.mamoe.mirai.internal.deps.io.ktor.client.engine.okhttp.OkHttp at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 49 more 2022-11-05 21:12:44 E/main: Failed to init MiraiConsole. java.lang.IllegalStateException: Exception while saving net.mamoe.mirai.console.internal.data.builtins.AutoLoginConfig@5e9456ae, saveName=AutoLogin at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.store(MultiFilePluginDataStorageImpl.kt:105) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.load(MultiFilePluginDataStorageImpl.kt:52) at net.mamoe.mirai.console.internal.data.builtins.ConsoleDataScopeImpl.addAndReloadConfig(ConsoleDataScopeImpl.kt:41) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:265) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:508) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54) Caused by: java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813) at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729) at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403) at kotlin.collections.CollectionsKt___CollectionsKt.firstOrNull(_Collections.kt:272) at net.mamoe.mirai.utils.ServicesKt.loadService(Services.kt:18) at net.mamoe.mirai.Mirai.findMiraiInstance(IMirai.kt:357) at net.mamoe.mirai._MiraiInstance.get(IMirai.kt:348) at net.mamoe.mirai.Mirai.getInstance(IMirai.kt:39) at net.mamoe.mirai.internal.message.MessageSerializersImpl.getSerializersModule(MessageSerializersImpl.kt:65) at net.mamoe.mirai.message.MessageSerializers$INSTANCE.getSerializersModule(MessageSerializers.kt) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl$store$2$1.invoke(MultiFilePluginDataStorageImpl.kt:96) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl$store$2$1.invoke(MultiFilePluginDataStorageImpl.kt:95) at kotlinx.serialization.json.JsonKt.Json(Json.kt:138) at kotlinx.serialization.json.JsonKt.Json$default(Json.kt:136) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.store(MultiFilePluginDataStorageImpl.kt:95) ... 7 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.mamoe.mirai.internal.MiraiImpl at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789) ... 21 more
-
https://github.com/mamoe/mirai/issues/2329
https://github.com/mamoe/mirai/issues/23242.13.0 有问题
请暂时降低版本到 2.13.0-RC2 -
@cssxsh 了解了,非常感谢!
-
-
-
@sweetymajo 你解决问题了吗?我也遇到同样的问题,并且我找不到2.13.0-RC2的资源,我该怎么降低版本
-
@JiuMu-i 在build.gradle.kts这个文件中,修改id("net.mamoe.mirai-console")这行后面的version为"2.13.0-RC2"