无法解析':app @ debugAndroidTest / compileClasspath'的依赖项

时间:2018-11-16 10:03:38

标签: java android android-studio android-preferences

无法解决':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-idling-resource:3.0.2.的依赖性

这是有关android studio版本的信息:

  

Android Studio 3.2.1 Build#AI-181.5540.7.32.5056338,建于10月   2018年9月9日JRE:1.8.0_152-release-1136-b06 amd64 JVM:OpenJDK 64位   JetBrains s.r.o Windows 10 10.0版的服务器VM

这是gradle项目:

buildscript {
   repositories {
  google()
jcenter()
 }
 dependencies {  classpath 'com.android.tools.build:gradle:3.2.1' } }}
allprojects {repositories { jcenter() maven {  url "https://maven.google.com"}}}
task clean(type: Delete) { delete rootProject.buildDir}

这是Gradle APP

apply plugin: 'com.android.application'
android { compileSdkVersion 28   defaultConfig { 
 applicationId "com.example.alyossrgf.myapplication"
 minSdkVersion 15
targetSdkVersion 28
versionCode 1
 versionName "1.0"
 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"}
 buildTypes {   release {  minifyEnabled false 
 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }}}
dependencies {
 implementation fileTree(dir: 'libs', include: ['*.jar'])
 implementation 'com.android.support:appcompat-v7:28.0.0'
 implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 testImplementation 'junit:junit:4.12'
 androidTestImplementation 'com.android.support.test:runner:1.0.2'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}

可以帮助解决此错误

  

无法解决':app @ debugAndroidTest / compileClasspath'的依赖关系:无法解决com.android.support.test.espresso:espresso-idling-resource:3.0.2。

1 个答案:

答案 0 :(得分:0)

也许您应该使项目干净(Build -> Clean Project)或清除Android Studio缓存(File -> Invalidate Caches / Restart -> Invalidate and Restart)?