Dagger2 in Eclipse not generating classes

752 Views Asked by At

I'm trying to set up a new App with Mortar. For this I am trying to build the mortar HelloWorld projects. I have to use Eclipse because Android Studio does not support native debugging (I prefer Android Studio and Gradle much more).

  • The mortar-helloworld example with Dagger1 works in Eclipse (Ant) when I set up Dagger1 like described here
  • The mortar-hellodagger2 example works when I build it with Maven
  • However when I try to build the mortar-hellodagger2 example with Eclipse (Ant) I get a ClassNotFoundException: com.example.mortar.Dagger_Main_Component.

I did set up Dagger2 like Dagger1 and put the libs in the folders like this:

libs: dagger-2.0, javax.inject-1
compile-libs: dagger-compiler-with-dependencies-2.0.jar

Has anyone successfully set up Eclipse with Dagger2?

1

There are 1 best solutions below

1
Michael On

You have to enable annotation processing in Eclipse. Right click on the project > Properties > Java Compiler > Annotation Processing > Enable ...