【发布时间】:2017-11-23 21:09:16
【问题描述】:
我正在尝试构建一个项目,但它一直给我这个 gradle 错误 我已将我的 gradle 3.3 和我的 android 插件版本升级到 2.3.3 但它仍然给我错误 任何帮助,将不胜感激 错误:
错误:(40, 0) Gradle DSL 方法未找到:'implementation()' 可能的原因:
事件日志: Gradle 同步失败:在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到参数 [com.android.support.constraint:constraint-layout:1.0.2] 的方法 implementation()。
build.gradle 文件:
buildscript {
ext.kotlin_version = '1.1.2-5'
ext.support_lib_version = '25.3.1'
ext.junit_version = '4.12'
ext.constraint_layout_version = '1.0.2'
ext.rxjava_version = '1.1.3'
ext.rxandroid_version = '1.1.0'
ext.mpchart_version='v3.0.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties 文件:
#Mon Jun 19 10:49:52 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
【问题讨论】:
-
检查找不到参数的方法 implementation() [com.android.support.constraint:constraint-layout:1.0.2
-
我做到了,什么也做不了
-
上传你的应用.gradle文件
标签: android android-studio android-gradle-plugin build.gradle gradle-plugin