【发布时间】:2018-01-01 08:54:17
【问题描述】:
我尝试将一个 java 类转换为 Kotlin,它工作正常,但出现以下错误。我尝试重新下载下面建议的所有依赖项,但无济于事。请帮助我解决此错误。
错误:
Error:(2, 0) Unable to find method 'org.gradle.api.internal.file.DefaultSourceDirectorySet.<init>(Ljava/lang/String;Lorg/gradle/api/internal/file/FileResolver;)V'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>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.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
【问题讨论】:
-
你用的是什么版本的gradle?
-
类路径'com.android.tools.build:gradle:3.0.1'
-
尝试无效缓存/重启
-
现在试试....
-
还是同样的问题。说 kotlin 没有配置