Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StackOverflowError in databinding while trying to migrate Gradle plugin from 3.5.1 to 3.5.2

My goal is to migrate android gradle plugin from 3.5.1 to 3.5.2.

However, once I do that the build fails with the following error:

error: cannot generate view binders java.lang.StackOverflowError
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:209)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
    at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)

It clearly states that it has something to do with databinding, but the stacktrace is really poor. I've tried to apply additional compiler args to get some other insights with no luck.

Has anyone faced the same issue? Any tips?

like image 859
yarikfreerun Avatar asked Dec 04 '19 13:12

yarikfreerun


1 Answers

Looks like AGP 3.5.2 fails once you invoke ObservableField.get() inside your xml files. Please see this comment to similar problem at Google Issues Tracker.

You can try to just remove .get() usages from your codebase which is completely safe.

Edit: If you're using LiveData, make sure you're not using .getValue() in any of your XML files.

like image 117
ivkil Avatar answered Nov 04 '22 00:11

ivkil