首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Org.gradle.kotlin.kotlin-未找到dsl

Org.gradle.kotlin.kotlin-未找到dsl
EN

Stack Overflow用户
提问于 2019-11-26 15:59:21
回答 4查看 6.4K关注 0票数 7

在运行构建时,我得到以下错误

代码语言:javascript
复制
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

代码语言:javascript
复制
repositories {
    jcenter()
}
plugins {
    `kotlin-dsl`
    id("groovy")
}
dependencies{
    gradleApi()
    localGroovy()
}

我试了所有的方法,但还是不起作用

EN

回答 4

Stack Overflow用户

发布于 2020-02-18 00:42:01

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

票数 8
EN

Stack Overflow用户

发布于 2019-11-26 17:12:16

同样的构建文件也适用于我。尝试清除项目和主目录中的Gradle缓存,然后检查它是否可以工作。如果仍然失败,请尝试将Gradle和插件更新为最新版本的id("org.gradle.kotlin.kotlin-dsl") version "1.3.2"

票数 1
EN

Stack Overflow用户

发布于 2020-06-16 23:10:15

我也有同样的问题,所以我试了试gradle --info

日志如下:

代码语言:javascript
复制
Evaluating project ':buildSrc' using build file '/Users/fjh1997/mirai/buildSrc/build.gradle.kts'.
I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:1083->https://plugins.gradle.org:443: The target server failed to respond
Retrying request to {tls}->http://127.0.0.1:1083->https://plugins.gradle.org:443
I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:1083->https://plugins.gradle.org:443: The target server failed to respond
Retrying request to {tls}->http://127.0.0.1:1083->https://plugins.gradle.org:443
I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:1083->https://plugins.gradle.org:443: The target server failed to respond

似乎把请求传给了proxy 127.0.0.1:1083,但是我在本地gradle.properties文件中设置的proxy的url是127.0.0.1:8118,这是怎么回事?经过长时间的努力,我终于找到了。

实际上,您的系统中有两个gradle.properties配置文件,一个在您的项目/.gradle中,另一个在~/.gradle中,后者是gradle的全局设置。

如果全局设置为systemProp.http.proxyHost设置了变量,那么无论您在项目/.gradle/gradle.properties中设置什么,代理都不起作用,您必须在全局设置中更改它。

顺便说一句,我发现gradle的全局设置被我的android studio偏好所改变。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59046202

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档