MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    mirai 2.6.1 newBot 报错

    BUG反馈
    3
    7
    719
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kazusa1412 last edited by

      在 2.6.0 及以下没问题
      报错代码

      val bot = BotFactory.newBot(ywConfig.qqNumber, ywConfig.qqPassword) {
        
              fileBasedDeviceInfo("config/device.json")
          
              protocol = BotConfiguration.MiraiProtocol.ANDROID_PHONE
      }
      

      错误信息

      Exception in thread "main" java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated
      
      1 Reply Last reply Reply Quote 0
      • K
        Kazusa1412 last edited by

        Caused by: java.lang.NoClassDefFoundError: net/mamoe/mirai/utils/MiraiUtils

        Caused by: java.lang.ClassNotFoundException: net.mamoe.mirai.utils.MiraiUtils

        1 Reply Last reply Reply Quote 0
        • RainChan
          RainChan 摸鱼 last edited by RainChan

          确认你的依赖是否正确导入
          @Him188

          K 1 Reply Last reply Reply Quote 0
          • Him188
            Him188 last edited by

            确认你的依赖是否正确导入

            1 Reply Last reply Reply Quote 0
            • K
              Kazusa1412 @RainChan last edited by Kazusa1412

              @rainchan 在2.6.0及一下是没有这个问题的,我只是把 mirai-core 的版本改成2.6.1就有了,2.6.1 还需要加入其他的依赖吗

              api("net.mamoe:mirai-core:${Versions.mirai}")
              

              $J@U}7FEY5O(}IMV}4WX1J3.png

              1 Reply Last reply Reply Quote 0
              • K
                Kazusa1412 last edited by

                发现了 2.6.1没有把 utils 导进来
                ![16F1R1QCG{YBQ80D0`9ZV8.png

                1 Reply Last reply Reply Quote 0
                • K
                  Kazusa1412 last edited by

                  @Him188 我这里确定了是 2.6.1 的 mirai-core 没有导入 mirai-core-utils,在2.6.0及其以下和 2.7-M1-dev-1 均没有这个问题,这可能和 github action 的2.6.1 release 失败有关

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact