-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Component.Factory types must be nested within a @Component #790
Comments
I too have the same problem, and with |
I have the same issue building with ksp, @mustafatatarhan0 are you building with ksp as well? |
@kevinguitar I ran into this while trying to use Dagger KSP, too, yeah. I think in short, the deal is that Anvil doesn't currently support Dagger KSP. However, this draft PR #1001 went up 2 days ago, which is directly about getting the |
Edit: I just found out that component merging will not work regardless of K2 KAPT or KSP and needs to use the workarounds described in the link I got this error even with K2 Kapt enabled:
The component in question looks like this: @SingleIn(UserScope::class)
@MergeSubcomponent(UserScope::class)
interface UserComponent {
@Subcomponent.Factory
interface Factory {
fun create(
@BindsInstance userSession: UserSession,
@BindsInstance userCoroutineScope: UserCoroutineScope,
): UserComponent
}
fun inject(activity: MainActivity)
} I am using 2.5.0-beta09 with Kotlin 2.0.0 |
AppComponent.kt:
When anvil generate AppComponent.java, error comes:
error: @Component.Factory types must be nested within a @Component
What is the reason of this error ? How can I fix this ?
The text was updated successfully, but these errors were encountered: