MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接
    1. 主页
    2. zsd123ss
    3. 帖子
    Z
    • 资料
    • 关注 0
    • 粉丝 0
    • 主题 1
    • 帖子 3
    • 最佳 0
    • 有争议的 0
    • 群组 0

    zsd123ss 发布的帖子

    • RE: gradle引入依赖错误

      @Karlatemp 在 gradle引入依赖错误 中说:

      https://github.com/mamoe/mirai/issues/2402#issuecomment-1368473584

      将 org.jetbrains.kotlin.platform.type 定义为 jvm 即可

      我不会改....又出现新的错误了

      Cannot have two attributes with the same name but different types. This container already has an attribute named 'org.jetbrains.kotlin.platform.type' of type 'org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType' and you are trying to store another one of type 'java.lang.String'
      

      我在common/build.gradle文件新增了几行

      configurations.all {
          attributes {
              attribute(Attribute.of("org.jetbrains.kotlin.platform.type", String.class), "jvm")
          }
      }
      

      然后 common/build.gradle 就变成这样

      plugins {
          id 'org.jetbrains.kotlin.jvm' version '1.8.21'
      }
      
      dependencies {
          implementation "org.xerial:sqlite-jdbc:3.41.2.1"
          implementation 'com.alibaba.fastjson2:fastjson2:2.0.29'
          implementation 'org.yaml:snakeyaml:2.0'
      
          // chatgpt
          implementation 'com.github.plexpt:chatgpt:4.0.7'
          
          // mirai
          implementation 'net.mamoe:mirai-core:2.15.0-M1'
          
          implementation "net.kyori:adventure-api:4.13.1"
      }
      
      configurations.all {
          attributes {
              attribute(Attribute.of("org.jetbrains.kotlin.platform.type", String.class), "jvm")
          }
      }
      

      我看一个人在其中一个pull说的可能有用?但不知道要怎么做 Link

      大佬能详细点吗
      或者说我修改的文件错了?

      发布在 开发交流
      Z
      zsd123ss
    • gradle引入依赖错误

      我项目的Github地址

      在执行fabric:build的时候出现了报错

      Could not determine the dependencies of task ':fabric:shadowJar'.
      > Could not resolve all dependencies for configuration ':fabric:shadow'.
         > Could not resolve net.mamoe:mirai-core:2.15.0-M1.
           Required by:
               project :fabric > project :common
            > Cannot choose between the following variants of net.mamoe:mirai-core:2.15.0-M1:
                - androidRuntimeElements-published
                - jvmRuntimeElements-published
              All of them match the consumer attributes:
                - Variant 'androidRuntimeElements-published' capability net.mamoe:mirai-core:2.15.0-M1:
                    - Unmatched attributes:
                        - Provides org.gradle.category 'library' but the consumer didn't ask for it
                        - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
                        - Provides org.gradle.status 'release' but the consumer didn't ask for it
                        - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
                        - Provides org.jetbrains.kotlin.platform.type 'androidJvm' but the consumer didn't ask for it
                - Variant 'jvmRuntimeElements-published' capability net.mamoe:mirai-core:2.15.0-M1:
                    - Unmatched attributes:
                        - Provides org.gradle.category 'library' but the consumer didn't ask for it
                        - Provides org.gradle.libraryelements 'jar' but the consumer didn't ask for it
                        - Provides org.gradle.status 'release' but the consumer didn't ask for it
                        - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
                        - Provides org.jetbrains.kotlin.platform.type 'jvm' but the consumer didn't ask for it
      

      几个关键文件

      • fabric/build.gradle#L38
      • common/build.gradle#L14 (fabric模块依赖的common模块)
      发布在 开发交流
      Z
      zsd123ss
    • RE: 关于获取回复消息的问题

      见 https://mirai.mamoe.net/topic/1837/获取回复消息-quotereplay-指向原文的实现思路

      发布在 开发交流
      Z
      zsd123ss
    • 1 / 1