linkedin / dexmaker

A utility for doing compile or runtime code generation targeting Android's Dalvik VM
Apache License 2.0
1.86k stars 248 forks source link

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

Open snijsure opened 4 years ago

snijsure commented 4 years ago

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

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?

chenriquevz commented 4 years ago

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?

drewhannay commented 4 years ago

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