Android gradle 找不到方法 'org.grade.api.internal.file.DefaultSourceDirectorySet'

标签 android gradle

我尝试将一个 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.

最佳答案

尝试在 build.gradle 中更新 kotlin 版本。

ext.kotlin_version = '1.3.72'

关于Android gradle 找不到方法 'org.grade.api.internal.file.DefaultSourceDirectorySet',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48048340/

相关文章:

android - 无法在单选组中显示按钮的值

android - 我怎么知道是否是android :textColor has int or ColorStateList value

android - Gradle(Android Studio)不会生成jar文件

gradle - 我应该如何构造这些gradle任务依赖项?

Gradle publishToMavenLocal 不会将 jar 复制到本地 Maven 存储库

java - 动态地将项目添加到一组 PopupMenu

javascript - chrome移动浏览器上不是页面顶部但window.scrollY等于0

gradle - 除了另一个任务外,明确运行 Gradle DefaultTasks

android studio 无法检测到我的库

android - 两个 Wifi 设备之间的数据传输