我尝试在Android-Studio 1.2的build.gradle
文件末尾添加以下代码(根据这篇文章的建议):
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
但是得到了:
Error:(40, 0) Gradle DSL method not found: 'test()'
Possible causes:
- The project 'xxxxx' may be using a version of Gradle that does not contain the method.
- The build file may be missing a Gradle plugin.
我错过了什么?
androidTest
吗? - OpalandroidTest
,但是出现了相同的错误(只不过是test()
变成了androidTest()
)。 - Eric Leibenguthapply plugin: 'com.android.application'
。我尝试添加apply plugin: 'java'
和/或apply plugin: 'groovy'
,但这些显然与 Android 不兼容。 - Eric Leibenguth