running with Dagger in IntelliJ?

2,814 views
Skip to first unread message

Shane Witbeck

unread,
Aug 16, 2013, 8:18:46 PM8/16/13
to dagger-...@googlegroups.com
I'm circling back to using Dagger (1.1.0) and struggling to debug in IntelliJ.

Can someone let me know if it's currently possible to debug a Dagger project with IntelliJ? If so, what the steps are?

I'm currently using a gradle build and in IntelliJ running 'gradle clean compileJava' before running my project's main method.

Here's the specific exception I get at runtime:

java.lang.IllegalStateException: Module adapter for class com.xxx.cli.YyyClient$YyyModule 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)


Thanks!

Adrian Cole

unread,
Aug 16, 2013, 8:57:34 PM8/16/13
to dagger-...@googlegroups.com
You'll need the compiler in your dependencies under a "provided" configuration.

  provided 'com.squareup.dagger:dagger-compiler:1.1.0'
 
If you just want to test before getting fancy, mark the compiler dep as "compile" and see if that helps.

-A


--
You received this message because you are subscribed to the Google Groups "Dagger Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dagger-discus...@googlegroups.com.
To post to this group, send email to dagger-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shane Witbeck

unread,
Aug 16, 2013, 11:33:51 PM8/16/13
to dagger-...@googlegroups.com
Adrian, thanks for the pointer but my issue was two-fold which I'll document here in case someone else has the same issue:

First, I already had 'compile' for dagger-compiler dependency in my gradle config because  'provided' didn't resolve. I found that I needed to add the folllowing in order to get 'provided' to work:

configurations {
    provided
}

Second, apparently annotation processing is disabled by default in IntelliJ. I enabled via Settings > Compiler > Annotation Processors > "Enable annotation processing" checkbox.
Reply all
Reply to author
Forward
0 new messages