Skip to content

Cannot find symbol _LazyMapKey in Dagger 2.53 #1079

Open
@bddckr

Description

Using Anvil 2.5.0 with Dagger version 2.52 I have no issues. But updating Dagger to 2.53 (and doing no other changes to the project) gives issues when @LazyClassKey is used:

/something/build/generated/source/kapt/debugAndroidTest/something/DaggerSomethingComponent.java:41: error: cannot find symbol
import something.SomethingElse_Module_ProvideType_LazyMapKey;
                                       ^
  symbol:   class SomethingElse_Module_ProvideType_LazyMapKey

The SomethingElse_Module is generated by my own code generator via Anvil.

// Generated by Anvil.
// https://github.com/square/anvil
@file:Suppress(
  "DEPRECATION",
  "OPT_IN_USAGE",
  "OPT_IN_USAGE_ERROR",
)

package something

import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import dagger.multibindings.IntoMap
import dagger.multibindings.IntoSet
import dagger.multibindings.LazyClassKey
import dagger.multibindings.StringKey
import kotlin.String
import kotlin.Suppress
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass

@Module
@ContributesTo(AppScope::class)
public object SomethingElse_Module {
  @Provides
  @IntoMap
  @LazyClassKey(SomethingElse::class)
  public fun provideType(): String =
      "SomethingElse"
}

Note that I had to rename/hide some sensitive details here. Hopefully it still makes sense.

I can work on a reproducer, if required. Didn't dig down into it just yet and wanted to open the issue in the meantime.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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