-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
Factory ProcessorModule not picked up with dagger 1.2.1 #76
Comments
Caused when using dagger 1.2.1 It works when using dagger 1.2.0 |
Using dagger in the processor was a bit of an experiment. I'll try to reproduce this error and get a fix in, but if it doesn't work out we can just ditch DI for this. |
If you remove the DI, will I still be able to use the generated factory as-is (no special provider method)? My gut feeling is that it's probably just the 'addsTo' that should be replaced by an 'includes', iirc the 'addsTo' behavior has changed with dagger 1.2.1. |
Um... what? |
From the almost non existing documentation of dagger, it was my understanding that addsTo was more of a hint that you'll plus() the module, and instead you should use include(?). "Dev note: From an implementation perspective, addsTo= and includes= both permit analysis to be performed across the module boundary (takes into account bindings from the referred-to module) but addsTo won't instantiate module instances the way includes= does, since it assumes the module and its inclusions to exist in the parent." If you check the source code of auto factory processor module: You'll see that it 'addsTo' and thus will not instantiate the ProcessorModule(?). It's mostly guessing from my position, so forgive me if I'm wrong. :) |
In any case, |
Just tried playing with AutoFactory, got the same error. Reverting to Dagger 1.2.0 fixed it. (not really though, I really want to use 1.2.1). |
Just ran into this error... |
Ran in to this error as well with Dagger 1.2.2. |
Does downgrading to 1.2.0 @pyricau or anyone cause any negative effects if going from 1.2.0 -> 1.2.1? I'm at the point where I should start using auto otherwise codebase quality will degrade... Unless there will be an auto update or dagger update to fix this issue.... |
It also happens with Dagger 1.2.2 |
Any news on this? Compatibility with Dagger 1.2.2 (or 2.0 for that matter) would be really nice. |
Has this been resolved in the past 4 years? |
I'm still quite new to dagger and the auto tools (great libs btw!) and I'm trying out auto factory. However I get an error that I don't know how to fix? I use dagger 1.2.1. and afaik I'm doing nothing fancy. (just annotating a class with autofactory). All these types seem to be defined by the ProcessorModule, so I'm a bit puzzled as to why they're not picked up.
java: java.lang.IllegalStateException: Errors creating object graph:
javax.annotation.processing.Messager could not be bound with key javax.annotation.processing.Messager required by class com.google.auto.factory.processor.AutoFactoryProcessor
javax.lang.model.util.Elements could not be bound with key javax.lang.model.util.Elements required by class com.google.auto.factory.processor.AutoFactoryProcessor
javax.lang.model.util.Types could not be bound with key javax.lang.model.util.Types required by class com.google.auto.factory.processor.AutoFactoryProcessor
javax.annotation.processing.Filer could not be bound with key javax.annotation.processing.Filer required by class com.google.auto.factory.processor.FactoryWriter
The text was updated successfully, but these errors were encountered: