android - 无法访问 'kotlin.collections.Collection',它是 'org.gradle.api.artifacts.dsl.RepositoryHandler' 的父类(super class)型

标签 android kotlin build.gradle gradle-kotlin-dsl

enter image description here
添加 Plugins{ `kotlin`} 后出现上述错误到我的 build.gradle.kts 文件。
我有谷歌这个问题并在删除所有 .gradle、.idea 目录后重建,但这个问题仍然存在。此外,我尝试使缓存无效,但不起作用。
对这个问题有什么想法吗?

最佳答案

您可以尝试手动删除Android Studio的Cache文件夹~/Library/Caches/Google/AndroidStudio4.2我在升级 Android Studio 4.2、Kotlin 1.5 和 Gradle 7.0 时遇到了同样的问题。这个解决方案解决了我的问题

关于android - 无法访问 'kotlin.collections.Collection',它是 'org.gradle.api.artifacts.dsl.RepositoryHandler' 的父类(super class)型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68134482/

相关文章:

android - 错误 :Module 'app' : platform 'Google Inc.:Google APIs:23' not found

java - 如何通过Java处理TextInputLayout

android-studio - Drop column Room迁移android

kotlin - 循环遍历 Kotlin x 次,但不使用索引

android - androidstudio2多种APK

android-studio - Jetpack Compose 和 Hilt 冲突

java - 无法运行程序 "bash": Launching failed?

Android::需要 Galaxy note3,4,5,6 AVD

android - Webview Android App 中的网站通知

environment-variables - 如何在 Kotlin 中读取环境变量?