I'm using Dagger for dependency injection in Android, using Eclipse to build. I've cloned android-activity-graphs to use as an example.
I've set up my environment according to staxgr from https://github.com/square/dagger/issues/126
These are my libs: dagger-1.1.0.jar, dagger-compiler-1.1.0.jar, and javax.inject.jar
And lastly, I've changed the source folders in Eclipse to point to src/main/java
(instead of just src/
) so that Eclipse detects the related files through the package keyword.
The project builds, but fails immediately when it's run with this exception:
Caused by: java.lang.IllegalStateException:
Module adapter for class
com.example.dagger.activitygraphs.AndroidModule could not be loaded.
Please ensure that code generation was run for this module.
at dagger.internal.FailoverLoader.getModuleAdapter(FailoverLoader.java:41)
at dagger.internal.Modules.getAllModuleAdapters(Modules.java:43)
at dagger.ObjectGraph$DaggerObjectGraph.makeGraph(ObjectGraph.java:167)
at dagger.ObjectGraph$DaggerObjectGraph.access$000(ObjectGraph.java:134)
at dagger.ObjectGraph.create(ObjectGraph.java:126)
at com.example.dagger.activitygraphs.DemoApplication.onCreate(DemoApplication.java:29)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
How do I get Dagger examples to work through eclipse?