I have a problem with project build. I wrote my own annotation processor. It is generating helper class to use with Android context based on other, contextless class. This generated class is intended to use inside XML files that uses Data Binding. I use Kotlin and kapt. So let's say I have a class Helper
. My annotation processor generates HelperAndroid
. And inside my Data Binding XML layout I have <import type="package.HelperAndroid" />
.
My problem is that during first compilation I get an error: ****/ data binding error ****msg:Cannot resolve type for HelperAndroid file:path/to/xml/file.xml loc:lines ****\ data binding error ****
. But in Build window in Android Studio I can see that my HelperAndroid
class is generated before this error is raised (I added Diagnostic.Kind.NOTE
logs to the console). On second attempt project compiles successfully.
Is there any way to force order of annotation processors?