Home » Android » google play services – Use Android DataBinding plugin parallel to GoogleServices plugin

google play services – Use Android DataBinding plugin parallel to GoogleServices plugin

Posted by: admin May 14, 2020 Leave a comment

Questions:

was anyone able to use Android DataBinding plugin parallel to GoogleServices pluginplugin?

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.1'
    classpath 'com.google.gms:google-services:1.4.0-beta3'
    classpath 'com.android.databinding:dataBinder:1.0-rc1'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.databinding'

And then the whole project just exploded. When I remove services plugin then databinding works.

This is gradle’s stacktrace.

How to&Answers:

No need to downgrade. There is/was a bug in some versions of the gradle plugin. To make things better, the Data Binding docs are a little out of date. Ignore the parts about how to get it set up. Try this instead:

Answer:

I had exactly the same problem.

On a new project, I had databinding working perfectly, even without the declare it enabled.

But after add new GoogleServices support, I had exactly the same error.

Add:

Fixed.

My Project gradle file (hope help someone):

. . .