Espresso Tests cannot access class file

∥☆過路亽.° 提交于 2019-12-04 23:35:56

The build.gradle explicitly excludes all dependencies of the production apk, which in turn, excludes the compat library from the instrumentation apk. I am not sure why this is required because I have never experienced that bug mentioned in the comment.

Basically, removing this block:

configurations.implementation.dependencies.all { implementationDependency ->
    println "Excluding implementation dependency: ${implementationDependency.getName()}"
    configurations.androidTestImplementation.dependencies.all { androidTestImplementationDependency ->
        configurations.androidTestImplementation.exclude module: "${implementationDependency.getName()}"
    }
}

will fix it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!