I am using Dagger2 for DI. My project has 2 modules, a module :common, which is a library, and a module :app, which is the actual application.
In the library module, I have AndroidAppone that extends MultiDexApplicationand inherits in the module :app. I added a Google dagger2 example to add DI with Dagger2.
Every time I run the application, I get the following message as an error:
Android/common/src/main/java/com/common/AndroidApp.java:10: The import com.common.di.DaggerAndroidAppComponent cannot be resolved.
but the weird part is what Android Studio says BUILD SUCESSFULLand the application works without problems.
When I try to run tests (androidTest) in the library module :common, I get the following error:
Error:Execution failed for task ':common:packageAllDebugAndroidTestClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: javax/annotation/Generated.class
I assume there is no connection between the two errors, but can anyone understand what is happening and how to fix the tests?
source
share