Release with gradle 2.0.0 and DataBinding

I recently updated Android studio from 1.5.1 to 2.0, after the update, he asked me to use the latest gradle ie com.android.tools.build:gradle:2.0.0

 dependencies { classpath 'com.android.tools.build:gradle:2.0.0' classpath "com.android.databinding:dataBinder:1.0-rc1" } 

But after the update, it shows an error with the DataBinding plugin.

 apply plugin: 'com.android.databinding' //error on this line 

Error message:

 Error:(2, 0) Cause: org/apache/commons/lang3/StringUtils Open File 

I have not used any apache library or any modified apache classes.

UPDATE:

The answer to Harshad helped me, so the final conclusion is: we do not need to add these plugins with gradle 2.0.+

classpath "com.android.databinding:dataBinder:1.0-rc1" remove
apply plugin: 'com.android.databinding' remove

+5
source share
1 answer

It can help you.

You can simply delete these two lines of code:

 apply plugin: 'com.android.databinding' 

And this is in the buildscript dependencies:

 classpath 'com.android.databinding:dataBinder:1.0-rc1' 

Then add the dataBinding section to your build.gradle as follows.

 buildscript { ... } android { ... dataBinding { enabled = true } ... } dependencies { ... } 
+7
source

Source: https://habr.com/ru/post/1246671/


All Articles