2014-11-05 74 views
0

在Android工作室,包括濃縮咖啡時,在我的Android項目gradle.build下谷歌的說明我有不支持的方法的gradle instrumentTestCompile:
https://code.google.com/p/android-test-kit/wiki/Espresso#Espresso_Setup_Instructions不受支持gradle這個方法instrumentTestCompile

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

完全錯誤:

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 

回答

5

我發現這裏的響應:
http://android.amberfog.com/?p=894

instrumentTestCompile()在gradle這個插件的最新版本更名爲androidTestCompile()

+0

由於沒有在SO上找到答案,因此出於文檔目的。 – 2014-11-05 17:30:52

+0

那個和testCompile有什麼區別? – 2015-04-06 20:18:28

+0

它在這裏回答:http://stackoverflow.com/questions/29021331/confused-about-testcompile-and-androidtestcompile-in-android-gradle – 2015-04-07 07:07:50

相關問題