Skip to content

Detect @Inject constructors on framework components #21

@jzbrooks

Description

@jzbrooks

Fragments, Activities, etc should use @AndroidEntryPoint to perform member injection. @Inject constructs won't work here since the framework instantiates the components and dagger has no opportunity to provide constructor parameters.

The main value of this check is an explanation to engineers new to dagger why this is wrong. A quick fix should be doable for this. The detector and fix should work for both Java and Kotlin source.

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