@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
大佬能详细点吗
或者说我修改的文件错了?