【问题标题】:Gradle sync failed: Could not find method Dependencies() for argumentsGradle 同步失败:找不到参数的方法 Dependencies()
【发布时间】:2018-01-27 10:38:16
【问题描述】:

完全错误:

Gradle sync failed: Could not find method Dependencies() for arguments [build_aewao5k4tyewg69imdynjiuxi$_run_closure1$_closure3@7c332105] on object of type org.gradle.api.internal.initialization.DefaultScriptHandler.

顶级 build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }

   Dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}

【问题讨论】:

    标签: android android-gradle-plugin build.gradle gradle-plugin gradle-dependencies


    【解决方案1】:

    使用dependencies(带有小d)代替Dependencies

    【讨论】:

    • 不敢相信!谢谢!
    • 乐于助人:)
    • @Ezio 能否请您或任何人分享一些关于字符大小写问题的信息/链接?谢谢!!
    • gradle 只不过是一个 groovy 脚本,而 groovy 是一种像 Java 一样区分大小写的语言。例如,如果你在 java 中键入 Int 而不是 int,它将不起作用,这里应用同样的东西
    【解决方案2】:

    将依赖项更改为依赖项

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
    

    【讨论】:

      猜你喜欢
      • 2016-10-05
      • 2019-04-02
      • 1970-01-01
      • 1970-01-01
      • 2019-07-26
      • 1970-01-01
      • 2023-03-21
      • 2020-01-19
      • 1970-01-01
      相关资源
      最近更新 更多