今天我安装了 Android Studio,打开程序后,我在消息 Gradle 同步部分 -> 中看到此错误
Error:(31, 0) Could not find method androidTestCompile() for arguments [com.android.support.test.espresso:espresso-contrib:2.2.2, build_4zwzygftganlohhaghm2dsums$_run_closure3@7658f1d6] on project ':app' of type org.gradle.api.Project.
<a href="openFile:C:\Users\Dany\AndroidStudioProjects\MyApplication3\app\build.gradle">Open File</a>
Run Code Online (Sandbox Code Playgroud)
我的 gradle-module 中有这段代码 ->
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.dany.myapplication"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
exclude group: 'com.android.support', module: …Run Code Online (Sandbox Code Playgroud)