I have an issue with Dagger and my own generated code.
Assumptions:
- I need to generate my own dagger component for UI tests purpose
- I have my own Gradle's module for annotation processing which provides dagger component with dependencies. Call this
GeneratedTestCoreComponent
. This class is generated correctly GeneratedTestCoreComponent
is built at\build\generated\source\kapt\debug\...
GeneratedTestCoreComponent
is used in dagger component, smth like this
@Component(modules = [UiTestModule::class],
dependencies = [GeneratedTestCoreComponent::class])
interface TestUiComponent {}
- My annotation processor module is correctly added to gradle
implementation project(path: ':processor')
kapt(name: 'processor')
The issue is. During compilation I get below error
TestUiComponent.java:6: error: cannot find symbol
@com.dagger.Component(modules = {com.xxx.xxx.UiTestModule.class}, dependencies = {GeneratedTestCoreComponent.class})
symbol: class GeneratedTestCoreComponent
TestUiComponent.java:8: error: [ComponentProcessor:MiscError] com.dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface TestUiComponent
Additional info.
When I copy GeneratedTestCoreComponent
class from build directory to src (keeping the same package) and disable my processor, then everything works fine
androidTestImplementation
andkaptAndroidTest
but it hasn't helped – Dawid Podolak