0

I have an unsupported gradle method instrumentTestCompile when including espresso in my Android project gradle.build on Android studio following Google instructions:
https://code.google.com/p/android-test-kit/wiki/Espresso#Espresso_Setup_Instructions.

gradle.build:

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'
}

Complete error:

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
L. G.
  • 9,642
  • 7
  • 56
  • 78

1 Answers1

5

I found the response here:
http://android.amberfog.com/?p=894

instrumentTestCompile() was renamed to androidTestCompile() in the latest version of gradle plugin.

L. G.
  • 9,642
  • 7
  • 56
  • 78