Home > Software design >  Execution failed for task ':app:compileDebugAndroidTestJavaWithJavac'
Execution failed for task ':app:compileDebugAndroidTestJavaWithJavac'

Time:12-14

When I was going to write for a ui test by espresso, I get the following error when running the app to test

ERROR

Execution failed for task ':app:compileDebugAndroidTestJavaWithJavac'.
> Could not resolve all files for configuration ':app:debugAndroidTestCompileClasspath'.
   > Failed to transform transition-1.2.0.jar (androidx.transition:transition:1.2.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find transition-1.2.0.jar (androidx.transition:transition:1.2.0).
        Searched in the following locations:
            https://dl.google.com/dl/android/maven2/androidx/transition/transition/1.2.0/transition-1.2.0.jar

build.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

CodePudding user response:

After searching, I realized that only the following line of code needs to be added to the build.gradle

build.gradle

dependencies {
//...

androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'

}
  • Related