More than one file was found with OS independent path 'android/databinding/DataBindingComponent.java'

Viewed 4527

I got this error during build in android studio:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

More than one file was found with OS independent path 'android/databinding/DataBindingComponent.java'

I used this library to apply generic adapter with databinding. My app already turn on databinding

  dataBinding {
    enabled = true
  }

The example from this library works fine, but don't know why it duplicates DataBindingComponent in my app.
Is there any clue to figure out it?

1 Answers

I meet this problem when I update my Android Studio to 3.0 version.
fixed by add packagingOptions:

android{
    packagingOptions {
        exclude 'android/databinding/DataBinderMapper.java'
        exclude 'android/databinding/DataBindingComponent.java'
        exclude 'android/databinding/DynamicUtil.java'
    }
}
Related