dexmaker icon indicating copy to clipboard operation
dexmaker copied to clipboard

More than one file was found with OS independent path 'mockito-extensions/org.mockito.plugins.MockMaker'

Open snijsure opened this issue 6 years ago • 2 comments

I am working on project where we are just now switching from gradle 4.10 to gradle 5.1 and upgrading to latest version android gradle plugin

However I am encountering following error when using gradle 5.1

  • What went wrong: Execution failed for task ':app:mergeDebugAndroidTestJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'mockito-extensions/org.mockito.plugins.MockMaker'

Note we do have file in src/test/resources/mockito-extensions/ that allows us to mock kotlin classes.

This setup (file in src/test/.... directory) has worked fine when using gradle 4.X

Was wondering if this is a known issue and if there is way to fix it?

snijsure avatar Nov 19 '19 18:11 snijsure

I have the same issue, only after adding,androidTestImplementation 'org.mockito:mockito-android:2.28.2' to my project.

My solution was to remove "androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.12.1'", kept only TestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.12.1'"

Did you find a solution?

chenriquevz avatar Jan 25 '20 18:01 chenriquevz

I think this can maybe happen if you're using both dexmaker-mockito and mockito-android or mockito in your androidTestImplementation. Both of these libraries do the same thing, so you can remove everything except dexmaker-mockito from androidTestImplementation

drewhannay avatar Jan 28 '20 21:01 drewhannay