不支持的gradle方法instrumentTestCompile

时间:2014-11-05 17:28:59

标签: android android-studio android-gradle android-espresso

我在Android工作室的Android项目gradle.build中按照Google的说明在我的Android项目dependencies { instrumentTestCompile files('libs/espresso-1.1.jar', 'libs/testrunner-1.1.jar', 'libs/testrunner-runtime-1.1.jar') instrumentTestCompile 'com.google.guava:guava:14.0.1', 'com.squareup.dagger:dagger:1.1.0', 'org.hamcrest:hamcrest-core:1.1', 'org.hamcrest:hamcrest-integration:1.1', 'org.hamcrest:hamcrest-library:1.1' } 中包含espresso时,我有一个不受支持的gradle方法instrumentTestCompile:
https://code.google.com/p/android-test-kit/wiki/Espresso#Espresso_Setup_Instructions

gradle.build:

Build script error, unsupported Gradle DSL method found: ‘instrumentTestCompile()’!
Possible causes could be:
– you are using Gradle version where the method is absent
– you didn’t apply Gradle plugin which provides the method
– or there is a mistake in a build script

完成错误:

{{1}}

1 个答案:

答案 0 :(得分:5)

我在这里找到了回复:
http://android.amberfog.com/?p=894

instrumentTestCompile()已在最新版本的gradle插件中重命名为androidTestCompile()