Reputation: 318
Within an existing project with espresso tests, I want to parameterized espresso tests so I add in the project configuration the declaration
implementation 'com.google.testparameterinjector:test-parameter-injector:1.14'
Then after synchronization, in the AndroidJUnit4 kotlin test classes, I got an error message for importing Matchers and I cannot execute the tests anymore and I still haven't parameterized the tests
import org.hamcrest.Matchers.*
Unresolved reference:Matchers
What's wrong with both libraries or my usage ?
Upvotes: 2
Views: 105
Reputation: 318
My workaround to the problem of this probable dependency conflict is to import the library only for the tests and that's not a restriction since it's only for testing !
androidTestImplementation 'com.google.testparameterinjector:test-parameter-injector:1.14'
and then it compiles
Upvotes: 0
Reputation: 129
Check for any dependency conflicts in your project. It's possible that there are conflicting versions of libraries that are causing issues. Look for multiple versions of hamcrest-core or any other dependencies that might be related to Matchers. If you find conflicting versions, you can try excluding one version to resolve the conflict.
implementation("com.google.testparameterinjector:test-parameter-injector:1.14") { exclude group: 'org.hamcrest', module: 'hamcrest-core' }
Upvotes: 0