错误:(22,0)找不到参数的方法实现()[com.android.support.constraint:constraint-layout:1.1.0-beta3]

时间:2017-11-18 20:51:28

标签: android gradle android-gradle build.gradle

我想问我的脚本错误22 gradle。我的剧本出了什么问题?

我正在尝试构建一个项目,但它一直给我这个gradle错误。我已将我的gradle版本升级到3.3并将我的android插件版本升级到2.3.3但它仍然给我错误。任何帮助将不胜感激。

错误:

Error:(40, 0) Gradle DSL method not found: 'implementation()' Possible causes:

The project 'sms-mining-android' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Upgrade plugin to version 2.3.3 and sync project

The project 'sms-mining-android' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file

The build file may be missing a Gradle plugin. Apply Gradle plugin

Event Log: Gradle sync failed: Could not find method implementation() for arguments [com.android.support.constraint:constraint-layout:1.0.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Please include an image description here



apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.1.1"
    defaultConfig {
        applicationId "com.softdev.weekimessenger"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta3'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.rockerhieu.emojicon:library:1.3.3'
    compile 'com.google.firebase:firebase-ads:9.4.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

apply plugin: 'com.google.gms.google-services'

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

implementation() DSL需要 gradle v.4.x 以及 android插件for gradle 3.x。

更多info here