Skip to content

error: cannot find symbol import AnyModule_Companion_Provide_LazyMapKey #4740

Open
@HaliksaR

Description

@HaliksaR

configuration:
kotlin : 2.1.21
ksp : 2.1.21-2.0.1
dagger : 2.56.2 (use clean dagger)
proguard : disabled

@Module
interface AnyModule {

	companion object {

		@Provides
		@IntoMap
		@LazyClassKey(AnyFragment::class)
		fun provide(deps: AnyComponent.Deps): Builder<*, *, *> =
			DaggerAnyComponent.builder()
				.deps(deps)
	}

	@Binds
	fun bindRouter(router: AnyRouterImpl): AnyRouter
}
app/di/DaggerAppComponent.java:168: error: cannot find symbol
import any.AnyModule_Companion_Provide_LazyMapKey;
                                     ^
  symbol:   class AnyModule_Companion_Provide_LazyMapKey
  location: package any

But there are no mistakes if you write

@Module
interface DepsModule {

	@Binds
	fun bindRouter(router: AnyRouterImpl): AnyRouter
}

@Module(includes = [DepsModule::class])
object AnyModule {

	@Provides
	@IntoMap
	@LazyClassKey(AnyFragment::class)
	fun provide(deps: AnyComponent.Deps): Builder<*, *, *> =
		DaggerAnyComponent.builder()
			.deps(deps)
}

Or if you stay on the previous configuration:

kotlin : 1.9.22
ksp : 1.9.22-1.0.17
dagger : 2.51.1

Or replace LazyClassKey to ClassKey.

I also tried connecting the kapt instead of the ksp, but the error was the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions