Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否于仅使用mirai-core的项目上运行 #1

Closed
ojhdt opened this issue Sep 22, 2022 · 2 comments
Closed

能否于仅使用mirai-core的项目上运行 #1

ojhdt opened this issue Sep 22, 2022 · 2 comments

Comments

@ojhdt
Copy link

ojhdt commented Sep 22, 2022

在尝试创建 deviceInfo 时出现有关 mirai-console 的错误。项目并未引入mirai-console,仅使用mirai-core。
运行平台:Android。

FATAL EXCEPTION: main
                                                                                                    Process: com.ojhdtapp.miraipluginforparabox, PID: 19010
                                                                                                    java.lang.NoClassDefFoundError: Failed resolution of: Lnet/mamoe/mirai/console/plugin/ResourceContainer;
                                                                                                    	at xyz.cssxsh.mirai.device.MiraiDeviceGenerator.<init>(MiraiDeviceGenerator.kt:23)
                                                                                                    	at com.ojhdtapp.miraipluginforparabox.domain.service.ConnService$onStartParabox$1.invokeSuspend(ConnService.kt:135)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7866)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
                                                                                                    	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@7499cc9, Dispatchers.Main.immediate]
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "net.mamoe.mirai.console.plugin.ResourceContainer" on path: DexPathList[[dex file "/data/data/com.ojhdtapp.miraipluginforparabox/code_cache/.overlay/base.apk/classes7.dex", dex file "/data/data/com.ojhdtapp.miraipluginforparabox/code_cache/.overlay/base.apk/classes8.dex", zip file "/data/app/~~cTHhr43bbruizziS6gpCLA==/com.ojhdtapp.miraipluginforparabox-nsYMt09QFK8GYbqftdx-yA==/base.apk"],nativeLibraryDirectories=[/data/app/~~cTHhr43bbruizziS6gpCLA==/com.ojhdtapp.miraipluginforparabox-nsYMt09QFK8GYbqftdx-yA==/lib/arm64, /data/app/~~cTHhr43bbruizziS6gpCLA==/com.ojhdtapp.miraipluginforparabox-nsYMt09QFK8GYbqftdx-yA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]
                                                                                                    	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                                    	... 12 more

启动代码:

bot = BotFactory.newBot(account, password) {
                    ...
                    deviceInfo = MiraiDeviceGenerator()::load
                }.also {
                    it.login()
                }

@cssxsh
Copy link
Owner

cssxsh commented Sep 22, 2022

哦 我不小心引入了 mirai-console 的 依赖
下个版本修复

@cssxsh cssxsh closed this as completed in a965641 Sep 22, 2022
@cssxsh
Copy link
Owner

cssxsh commented Sep 22, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants