Android DataBinding.setContentView returns null

Viewed 178

I created an app which is used as core for onDemand delivery.

One of the module have dataBinding enabled and when I start an activity from that module the app crashes with

java.lang.NullPointerException

ActivityLoginToVaultBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_login_to_vault);

binding is returning null.

the layout activity_login_to_vault contains as parent.

I need to mentions that is happening only for on demand delivery.

1 Answers

Here's the culprit in my onDemand module's AndroidManifest.xml. I initially had it as false when the binding nullPointer happened. Changing it to true, fixed the issue!

<dist:fusing dist:include="true" />
Related