We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dagger generates invalid code when an injected dependency is named "Create.java" or "Create.kt"
public static ExampleComponent create() { return new Builder().build(); } private Create create() { return new Create(ExampleModule_ProvideExampleDependencyFactory.provideExampleDependency(exampleModule)); }
'create()' is already defined ...
The private method should be renamed to something other than our dependencies to avoid the name conflict.
Reproducable repo here: https://github.com/richarddd/dagger-name-conflict
It could be sovled by postfixing the method with a hash value like hex(fletcher32(canonicalName)) or by adding a dagger prefix. Examples:
hex(fletcher32(canonicalName))
private Create daggerCreateCreateDependency() {...}
private Create createb886c8a7() {...}
The text was updated successfully, but these errors were encountered:
Using NameAllocator for the method names would solve it as well.
Sorry, something went wrong.
Fix an issue where a class named "Create" can conflict with the creat…
a6eb0c5
…e() factory method on the component. Fixes #3069. RELNOTES=Fix #3069 where a class named "Create" could cause a conflict. PiperOrigin-RevId: 419019730
5ba04fb
Successfully merging a pull request may close this issue.
Dagger generates invalid code when an injected dependency is named "Create.java" or "Create.kt"
'create()' is already defined ...
The private method should be renamed to something other than our dependencies to avoid the name conflict.
Reproducable repo here:
https://github.com/richarddd/dagger-name-conflict
It could be sovled by postfixing the method with a hash value like
hex(fletcher32(canonicalName))
or by adding a dagger prefix. Examples:The text was updated successfully, but these errors were encountered: