Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using retrolambda in project library causes databinding error #118

Closed
AleksanderMielczarek opened this issue Jul 25, 2015 · 3 comments
Closed
Labels

Comments

@AleksanderMielczarek
Copy link

When using retrolambda and databinding together in a library it gives an error. However without retrolambda in project library everything is working.

Link to repository with example: https://github.com/alekmiel/test-multimodule-binding

Error:

D:\Projekty\TestMultimoduleBinding\app\src\main\java\testmultimodulebinding\MainActivity.java:8: error: package testmultimodulebinding.databinding does not exist
import testmultimodulebinding.databinding.ActivityMainBinding;
                                         ^
warning: Supported source version 'RELEASE_7' from annotation processor 'android.databinding.annotationprocessor.ProcessDataBinding' less than -source '1.8'

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.RuntimeException: Found data binding errors.
****/ data binding error ****msg:Cannot find the setter for attribute 'app:integerSupplier' with parameter type testmultimodulebinding.IntegerSupplier. file:D:\Projekty\TestMultimoduleBinding\app\src\main\res\layout\activity_main.xml loc:20:35 - 20:59 ****\ data binding error ****
@evant evant added the bug label Jul 25, 2015
@runforprogram
Copy link

I also meet this issue,and i find not any useful info with google. by the error log message,it like mean that the databinding only support Java 1.7,but the retrolambda must use Java 1.8?

@evant
Copy link
Owner

evant commented Aug 4, 2015

@runforprogram that warning can be safely ignored, since java 8 should support java 7 processors fine. The real issue here is that the @BindingAdapter defined in the library project is not being picked up by the app project.

@evant
Copy link
Owner

evant commented Aug 11, 2015

This is due to databinding using non-class files in it's build output. Previous versions of retrolamba did not copy these files over when doing processing, but it was fixed in 2.0.4. (See luontola/retrolambda#54). You can simply point to a newer version of retrolamba by doing

dependencies {
    retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:2.0.4'
}

or wait until the next release which will default to the latest version.

@evant evant closed this as completed Aug 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants