dagger-2-testing-demo icon indicating copy to clipboard operation
dagger-2-testing-demo copied to clipboard

cannot find symbol variable DaggerTestMyApplication_TestApplicationComponent

Open ghost opened this issue 7 years ago • 2 comments

Error:(17, 21) error: cannot find symbol variable DaggerTestMyApplication_TestApplicationComponent

ghost avatar Apr 18 '17 00:04 ghost

Hey, just in case anybody else having the same issue - after hour of googling and digging into Google discussion group. The solution is:

  1. Add classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' to build.gradle at top level.
  2. Add apply plugin: 'com.neenbedankt.android-apt'`` to build.gradle``` at app level.
  3. Add testApt "com.google.dagger:dagger-compiler:YOUR_VERSION" to build.gradle at app level.

Now everything should be generated correctly after rebuild.

darekg11 avatar May 24 '17 20:05 darekg11

I have defined the TestApplicationComponent outside of my TestApplication class. But now i have an issue when i call DaggerTestApplicationComponent.builder(), it doesn't recognize the DaggerTestApplicationComponent. Why is that?

lawloretienne avatar Jan 15 '18 20:01 lawloretienne