无法找到方法'org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.macosX64()
Unable to find method 'org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.macosX64()
我在我的多平台项目中使用 android、jvm 将 kotlin 从 1.3.61 更新为 1.3.70 ,ios 和 macosx64 目标不更改其他代码,每当尝试 gradle 同步时,我都会收到以下消息(当然,项目构建失败):
CONFIGURE FAILED in 3s
Unable to find method 'org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.macosX64()Lorg/jetbrains/kotlin/gradle/plugin/mpp/KotlinNativeTargetWithHostTests;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
我已经尝试过上述解决方案,我也尝试过清除 .gradle/caches
,但没有任何改变。可能是什么问题?
发生这种情况是因为我有一个 buildSrc
模块,其中依赖项的工件名称是这样声明的:
object Deps {
object Android {
// artifacts
}
object Native {
// artifacts
}
// ...
}
我在那里更新了 kotlin 依赖项,但我忘记更新 buildSrc
目录本身的 build.gradle.kts
中的 kotlin 版本。
我在我的多平台项目中使用 android、jvm 将 kotlin 从 1.3.61 更新为 1.3.70 ,ios 和 macosx64 目标不更改其他代码,每当尝试 gradle 同步时,我都会收到以下消息(当然,项目构建失败):
CONFIGURE FAILED in 3s
Unable to find method 'org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.macosX64()Lorg/jetbrains/kotlin/gradle/plugin/mpp/KotlinNativeTargetWithHostTests;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
我已经尝试过上述解决方案,我也尝试过清除 .gradle/caches
,但没有任何改变。可能是什么问题?
发生这种情况是因为我有一个 buildSrc
模块,其中依赖项的工件名称是这样声明的:
object Deps {
object Android {
// artifacts
}
object Native {
// artifacts
}
// ...
}
我在那里更新了 kotlin 依赖项,但我忘记更新 buildSrc
目录本身的 build.gradle.kts
中的 kotlin 版本。