android - org.gradle.kotlin.kotlin-dsl 未找到

标签 android gradle kotlin gradle-plugin

运行构建时出现以下错误

FAILURE: Build failed with an exception.

* Where:
Build file '/home/charming/mainframer/bigovlog_android/buildSrc/build.gradle.kts' line: 4

* What went wrong:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '1.2.6'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.2.6')
  Searched in the following repositories:
    Gradle Central Plugin Repository

我的 buildSrc/build.gradle.kts
repositories {
    jcenter()
}
plugins {
    `kotlin-dsl`
    id("groovy")
}
dependencies{
    gradleApi()
    localGroovy()
}

我尝试了一切但仍然无法正常工作

最佳答案

您是否检查过 Android Studio 没有在离线模式下运行?看看Preferences/Build, Execution, Deployment/Gradle/Global Gradle settings并查看是否选中了离线工作。

关于android - org.gradle.kotlin.kotlin-dsl 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59046202/

相关文章:

android - 抽象保存状态 View 模型工厂 : SavedStateProvider with the given key is already registered

使用带 https 地址的 HttpURLConnection 的 Android ICS 无法执行发布方法

android - Java 8 "Optional"不好的做法?

kotlin - 使用jOOQ DAO删除带有复合键的记录

android - 在 list 中声明时,RECEIVE_SMS 的广播接收器不起作用(静态)

android - CardView角落显示白色像素?

ios - 如何使用可扩展和清洁模式制作相同的 iOS Swift 应用程序,仅在代码和 Assets 方面存在一些差异

kotlin - Kotlin协程 future 等待超时(不取消)

testing - 在gradle中,测试配置如何声明对另一个项目的测试配置的依赖关系?

具有多个 Lib 文件夹的 Gradle 多项目依赖项