Gradle test编译错误

use*_*ash 8 android gradle android-studio build.gradle android-gradle-plugin

我正在尝试在Android Studio中构建项目Project。当我运行该应用程序时,出现以下错误:

Error:(10, 0) Gradle DSL method not found: 'testCompile()'
Possible causes:
-The project 'AccurateCalculator' 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.2 and sync project.The project 'AccurateCalculator' 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
Run Code Online (Sandbox Code Playgroud)

build.grade 该项目的代码如下:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
Run Code Online (Sandbox Code Playgroud)

build.gradle 模块的代码如下:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 17
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "calculator.app"
        minSdkVersion 14
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    compile files('libs/achartengine.jar')
    compile files('libs/arity-2.1.6.jar')
    compile files('libs/ejml-0.21.jar')
    compile files('libs/slider.jar')
}
Run Code Online (Sandbox Code Playgroud)

谁能帮忙吗?

提前致谢。

azi*_*ian 4

正如警告所示,升级插件应该2.3.2可以解决该问题:

classpath 'com.android.tools.build:gradle:2.3.2'
Run Code Online (Sandbox Code Playgroud)