One of your libraries relies on data binding and is distributed with generated data-binding classes built with build tools 3.3 (or earlier). The issue is caused by the breaking change introduced in the latest beta/rc version of the data binding lib. In version 3.4 the signature of androidx.databinding.ViewDataBinding
constructor has been changed from:
protected ViewDataBinding(DataBindingComponent bindingComponent, View root, int localFieldCount)
to:
protected ViewDataBinding(Object bindingComponent, View root, int localFieldCount)
Which makes any generated data binding class binary incompatible with 3.4 databinding lib, resulting in the following exception upon startup:
java.lang.NoSuchMethodError: No direct method <init>(Landroidx/databinding/DataBindingComponent;Landroid/view/View;I)V in class Landroidx/databinding/ViewDataBinding; or its super classes (declaration of 'androidx.databinding.ViewDataBinding' appears in /data/app/com.example.idolon-LqF2y8dUMxZoK3PVRlzbzg==/base.apk)
at com.example.lib.databinding.ActivityLibBinding.<init>(ActivityLibBinding.java:20)
at com.example.lib.databinding.ActivityLibBindingImpl.<init>(ActivityLibBindingImpl.java:30)
at com.example.lib.databinding.ActivityLibBindingImpl.<init>(ActivityLibBindingImpl.java:27)
at com.example.lib.DataBinderMapperImpl.getDataBinder(DataBinderMapperImpl.java:316)
at androidx.databinding.MergedDataBinderMapper.getDataBinder(MergedDataBinderMapper.java:74)
at androidx.databinding.DataBindingUtil.bind(DataBindingUtil.java:199)
at androidx.databinding.DataBindingUtil.bindToAddedViews(DataBindingUtil.java:327)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:306)
at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
As a workaround you can rebuild libraries that contains data binding classes using the latest build tools.
The corresponding bug on Androig Bug tracker is: https://issuetracker.google.com/issues/122936785
UPDATE
The issue has been fixed and the fix is available in 3.5 beta 1 (it will also be available in the upcoming 3.4.1)
androidx
in the project? The reason may be, that3.4.0-alpha10
usesandroidx
for data binding and therefore crashes. – Unessential3.4.0-beta05
build tools.3.3.1
works just fine. – Stump