2
votes

I created my own annotation processor library that generate a classes for user. But I got an error while providing those classes using Dagger2.

Here is the error message:

error: cannot find symbol

private Provider<NonExistentClass> provideUserDataProvider;
                   ^
  symbol:   class NonExistentClass
  location: class DaggerAppComponent

Can anyone explain me how to inject generated classes with Dagger2?

1

1 Answers

1
votes

By default, the Kotlin Annotation Processor replaces every unknown symbol by NonExistentClass.

This may not be suitable for every use cases. You can disable this behavior by setting the Kapt correctErrorTypes option to true.

See : http://kotlinlang.org/docs/reference/kapt.html#non-existent-type-correction

It should fix your problem.