Hook onto existing task, or control it somehow

I am getting this error:

Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDevDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/x86/libimagepipeline.so
        File1: /Users/Edgar/.android/build-cache/9ffbe9cf8a42fba1738a80e04df604e8c6297ad6/output/jni
        File2: /Users/Edgar/.android/build-cache/fe2711efebc0826693fa11773ed3cba6b263d013/output/jni

(Assume I cannot fix this)

Can I hook onto transformNativeLibsWithMergeJniLibsForDevDebug and say which of the two should be used?