3

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?

4

1 回答 1

8

当我将我的 Android Studio 更新到 3.0 版本时,我遇到了这个问题。
通过添加包装选项修复:

android{
    packagingOptions {
        exclude 'android/databinding/DataBinderMapper.java'
        exclude 'android/databinding/DataBindingComponent.java'
        exclude 'android/databinding/DynamicUtil.java'
    }
}
于 2017-10-27T07:17:55.367 回答