Kapt issues with DataBinding


#1

*Binding classes are not generated and I get an Execution failed for task “app:kaptDebugKotlin” error.
It may be an issue with other libraries in my app, but i am unable to reach to the point of failure.
Following libraries are currently used in project:

Dagger 2
RxJava 2
Databinding
Kotlin
Butterknife
Groupie (from lisawray)

I made some changes to add dagger.android support, and now i am unable to run the project and the error shows:

e: public class OrderBookItem extends Item {
e: ^
e: symbol: class RowOrderBookBinding
e: \app\src\main\java\com\somepackage\mobile\mf\reports\item\OrderBookItem.java:26: error: cannot find symbol
e:

e: @Override public void bind(RowOrderBookBinding viewBinding, int position) {
e: ^
e: symbol: class RowOrderBookBinding
e: location: class OrderBookItem

Around 40-50 errors of same type.
As I have around 40-50 layouts that use DataBinding.


Kapt "IllegalStateException: failed to analyze" when encountering a large amount of errors
#2

I think we may be encountering the same issue. I have created another discussion with more details here. Currently stuck in the spam filter, but the link should work soon.


#3

Hi, friend! Did you solve this problem? I use databiding & kotlin, yestoday ago, my project is all right. but last night, I don’t know why my project cannot be compiled! It’s too bad.


#4

Since I had just started kotlin integration, and it’s only limited to data
classes.
I created a copy of my project without kotlin, so if I working on a change
which breaks the build I do the same in the NoKotlin copy, find the issue
and resolve it.

I know it sounds stupid but I have not been able to find a better way.
I am holding off further kotlin conversion until there is a better way.


#5

This bug report was posted in the thread I linked earlier, but I figured I would put it here too. It sounds like it should fix the issue you are having.

https://youtrack.jetbrains.com/issue/KT-21264


#6

Did you get it fixed? Yesterday I implemented data binding in my kotlin android project, with dagger as DI.
When I tried to @Provides databinding it failed because dagger can’t find the generated class (NonExsitentClass error). When I use data binding without trying to provide it through the object graph - it works fine.

any idea? I feel like I’m doing half the work, not injecting the binding