Skip to content

Dagger doesn't implement component method if the method is used only in generated code #665

@jhutarek

Description

@jhutarek

Hi,

I've found strange problem when using custom annotation processor in project with Dagger. Minimal working sample here:
dagger-sample-repo-2.zip

Steps to reproduce (as implemented in attached project):

  1. Create MainComponent extending MyFeatureComponent.
  2. Add injection method to MyFeatureComponent.
  3. Create custom annotation processor that generates code that calls feature component's injection method (this method is not called from non-generated code).
  4. Try to compile the project: Build fails with "DaggerMainComponent is not abstract and does not override abstract method inject(MyFeatureFragment) in MyFeatureComponent" - the injection method inherited from MyFeatureComponent to MainComponent is not implemented.

Am I doing something wrong? Tried with latest Dagger version, latest build tools etc. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions