Gradle 未找到 DSL 方法:'testimplementation()'?

Gradle DSL method not found: 'testimplementation()'?

Gradle DSL method not found: 'testimplementation()' 

项目 'My Project' 可能正在使用不包含该方法的 Gradle 版本。 构建文件可能缺少 Gradle 插件。 应用 gradle 插件

我试过了已经试过了

  1. 删除项目的 .gradle 重新同步
  2. Invalidate/caches 并重启使用
  3. 本地gradle分发选项

Gradle 文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.techknocorp.a.metturcable"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 532016
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testimplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    androidTestImplementation 'com.android.support.test:runner:1.1.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso- 
 core:3.1.1'
    implementation files('libs/opencsv-2.3.jar')
}

顶级Gradle // 顶级构建文件,您可以在其中添加所有 sub-projects/modules.

通用的配置选项
buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
 }

 task clean(type: Delete) {
    delete rootProject.buildDir
 }

使用 testImplementation 代替 testimplementation

dependencies {
    //....
    testImplementation 'junit:junit:4.12'
    //..
}