После добавления зависимости androidx.test.espresso:espresso-contrib:3.2.0
я пытаюсь протестировать свой пользовательский интерфейс, и сборка не удалась из-за ошибок зависимости / ограничения. Я не нашел никакого решения в Интернете для androidx espresso-contrib
. Пожалуйста, помогите мне.
Заранее спасибо.
Журнал ошибок:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:javaPreCompileDebugAndroidTest'.
> Could not resolve all files for configuration ':app:debugAndroidTestCompileClasspath'.
> Failed to transform artifact 'espresso-contrib.aar (androidx.test.espresso:espresso-contrib:3.2.0)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
> Execution failed for AarToClassTransform: C:\Users\Almas\.gradle\caches\modules-2\files-2.1\androidx.test.espresso\espresso-contrib\3.2.0\55de2d3fd0f8286c18c3a30c445033f20cc314be\espresso-contrib-3.2.0.aar.
> Cannot parse result path string:
> Failed to transform artifact 'accessibility-test-framework.jar (com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.0)' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\Almas\.gradle\caches\modules-2\files-2.1\com.google.android.apps.common.testing.accessibility.framework\accessibility-test-framework\2.0\7837f95bdff9f797003454247fef02b78d49ae75\accessibility-test-framework-2.0.jar.
> Cannot parse result path string:
> Failed to transform artifact 'material.aar (com.google.android.material:material:1.0.0)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
> Execution failed for AarToClassTransform: C:\Users\Almas\.gradle\caches\modules-2\files-2.1\com.google.android.material\material\1.0.0\f83e012c22d2fac8fcf23880d7167832b099fa94\material-1.0.0.aar.
> Cannot parse result path string:
> Failed to transform artifact 'transition.aar (androidx.transition:transition:1.0.0)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
> Execution failed for AarToClassTransform: C:\Users\Almas\.gradle\caches\modules-2\files-2.1\androidx.transition\transition\1.0.0\f3556ce8f251984acb24014c3ba055ff235929ff\transition-1.0.0.aar.
> Cannot parse result path string:
Файл build.gradle приложения:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.testinginandroid"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
viewBinding {
enabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.preference:preference:1.1.0'
// Automation framework for Unit as well as UI testing
testImplementation 'junit:junit:4.12'
// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
// Espresso core dependencies
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Espresso contrib for DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
// Mocks (fakes) dependencies required by the class being tested
testImplementation 'org.mockito:mockito-core:1.10.19'
}