首页 > 解决方案 > 无法解析“:app@debugUnitTest/compileClasspath”的依赖关系:无法下载accessibility-test-framework.jar

问题描述

错误:无法解析':app@debugUnitTest/compileClasspath'的依赖关系:无法下载accessibility-test-framework.jar(com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1 ) 显示详细信息 受影响的模块:app

使用可访问性测试框架库来测试常见的可访问性问题。

这是我的 build.gradle(Module: App)

apply plugin: 'com.android.application'

repositories {
    maven {
        url 'https://repo1.maven.org/maven2/'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'
    defaultConfig {
        applicationId "com.pluralsight.candycoded"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }

    sourceSets.test.resources.srcDirs += ["src/main"]
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.picasso:picasso:2.71828'

    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'
    androidTestImplementation 'com.android.support:support-annotations:28.0.0'

    testImplementation 'junit:junit:4.12'
    testImplementation 'com.github.javaparser:javaparser-core:3.0.1'
    //testImplementation "org.mockito:mockito-core:2.+"
    testImplementation "org.powermock:powermock-module-junit4:1.7.1"
    testImplementation "org.powermock:powermock-api-mockito2:1.7.1"
    testImplementation "org.powermock:powermock-core:1.7.1"
    testImplementation 'org.robolectric:robolectric:4.3.1'
}

标签: androidtestinggradle

解决方案


推荐阅读