Search code examples
javadata-bindingandroid-databindingandroidxandroid-r8

Duplicate DatabindingComponent class found while generating bundle


I get this error when i try to generate App Bundle for release.

Component used: 'com.android.tools.build:gradle:4.1.0' 'com.google.gms:google-services:4.3.4'

Version used: Android studio 4.1

:app:minifyReleaseWithR8 FAILED /Users/androiddeveloper/Documents/udux_android/app/build/intermediates/module_and_runtime_deps_classes/release/base.jar: R8: Type androidx.databinding.DataBindingComponent is defined multiple times: /Users/androiddeveloper/Documents/udux_android/app/build/intermediates/module_and_runtime_deps_classes/release/base.jar:androidx/databinding/DataBindingComponent.class, /Users/androiddeveloper/Documents/udux_android/livestream/build/intermediates/module_and_runtime_deps_classes/release/feature-livestream.jar:androidx/databinding/DataBindingComponent.class

  • I am wondering if this should even happen as the documentation says databinding should be enabled in all modules.
  • I have tried to use dontnote in app's proguard's file but still doesnt solve the issue

Edit \ni have found an issue relating to this but for another class


Solution

  • I worked on two modules separately and when i decided to merged the tow modules into the main app. the DFM module had it on Databinding component class which somehow i felt was autogenerated.

    I ended up deleted the package androidx.databinding.Databinding component on the module and that was what solved my issue.