-
Notifications
You must be signed in to change notification settings - Fork 729
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
EpoxyDataBinding models not being generated, causing compilation to fail #1014
Comments
I manage to reproduce this in the Kotlin sample on my fork. This is the branch. Steps to reproduce:
|
I added the 'kapt.verbose' to my fork's gradle.properties and found that in the kotlinsample, when there's no changes on files referencing by the DataBinding processor, there are 0 rounds. Maybe this is due to incremental builds? Weird thing is that the ModelViewProcessor always do 3 rounds (I have not touched any of the files related to that processor). |
I found a solution but with two downsides. Changing the Downsides:
|
Thank you for the detailed report and investigation, I appreciate it! I believe I know the issue and have a fix (we ran into the same problem on another project). It is an incremental annotation processing bug. The root cause is a bit tricky - essentially the only annotation that the processor uses is the package annotation in The workaround is to put the annotation on anything else - a class or interface is the simplest. I need to change the source to allow the annotation to have @EpoxyDataBindingPattern(rClass = R.class, layoutPrefix = "view_holder")
@EpoxyDataBindingLayouts({R.layout.model_with_data_binding})
interface EpoxyDataBindingConfig {} Note that due to a quirk with annotation processing and how the layout name is extracted from the annotation during processing this file needs to be in java. I have fixed it in d470efe and am currently pushing a 4.0.0-beta5 release that should be available in the next hour |
In 4.0.0, with the EpoxyDataBindingPattern (based on layoutPrefix), sometimes when running the app (re-compiling with cache), the build fails because the extensions and the 'Model_'s can not be referenced. If I look inside the generated code package, there are not classes referencing my DataBinding models. This does not happen for ModelViews and EpoxyModelWithHolder.
Currently, I have two ways of generate the models again:
The second method has also worked for me for ViewBinding classes that for some reason, are deleted after compiling the app (the compilation error dissapears instantly.)
This does not happens with lower versions of the library (3.11 and below).
AS version: 4.0
gradle.properties file:
package-info.java:
Part of my app's module's build.gradle file:
The text was updated successfully, but these errors were encountered: