Skip to content
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

Assisted injection appears to not work correctly in some cases #4381

Closed
ZacSweers opened this issue Aug 7, 2024 · 3 comments
Closed

Assisted injection appears to not work correctly in some cases #4381

ZacSweers opened this issue Aug 7, 2024 · 3 comments

Comments

@ZacSweers
Copy link

Repro: slackhq/circuit#1561

Run: ./gradlew :samples:star:kspKotlinJvm -Pcircuit.buildDesktop

This works in KSP1, but appears to fail due to assisted-injection related reasons in KSP2.

> Task :samples:star:kspKotlinJvm FAILED
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.benchmark.ListBenchmarksPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.benchmark.ListBenchmarksPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.benchmark.ListBenchmarksPresenterFactory(factory)
    com.slack.circuit.star.benchmark.ListBenchmarksPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.benchmark.ListBenchmarksPresenterFactory_Factory_AppScope_MultiBindingModule_4518ba01.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.benchmark.ListBenchmarksItemPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.benchmark.ListBenchmarksItemPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.benchmark.ListBenchmarksItemPresenterFactory(factory)
    com.slack.circuit.star.benchmark.ListBenchmarksItemPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.benchmark.ListBenchmarksItemPresenterFactory_Factory_AppScope_MultiBindingModule_5e046fbe.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.petlist.PetListPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.petlist.PetListPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petlist.PetListPresenterFactory(factory)
    com.slack.circuit.star.petlist.PetListPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petlist.PetListPresenterFactory_Factory_AppScope_MultiBindingModule_c1ff0ea3.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.petlist.FiltersPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.petlist.FiltersPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petlist.FiltersPresenterFactory(factory)
    com.slack.circuit.star.petlist.FiltersPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petlist.FiltersPresenterFactory_Factory_AppScope_MultiBindingModule_022aaae4.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.petdetail.PetDetailPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.petdetail.PetDetailPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petdetail.PetDetailPresenterFactory(factory)
    com.slack.circuit.star.petdetail.PetDetailPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petdetail.PetDetailPresenterFactory_Factory_AppScope_MultiBindingModule_bd64c9b9.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()
e: [ksp] [Dagger/MissingBinding] com.slack.circuit.star.petdetail.PetPhotoCarouselPresenter.Factory cannot be provided without an @Provides-annotated method.

    com.slack.circuit.star.petdetail.PetPhotoCarouselPresenter.Factory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petdetail.PetPhotoCarouselPresenterFactory(factory)
    com.slack.circuit.star.petdetail.PetPhotoCarouselPresenterFactory is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.petdetail.PetPhotoCarouselPresenterFactory_Factory_AppScope_MultiBindingModule_8802e9ec.bindFactory(real)
    java.util.Set<com.slack.circuit.runtime.presenter.Presenter.Factory> is injected at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CircuitModule.Companion.provideCircuit(presenterFactories, …)
    com.slack.circuit.foundation.Circuit is requested at
        [com.slack.circuit.star.di.MergedAppComponent] com.slack.circuit.star.di.CommonAppComponent.getCircuit()


@kuanyingchou
Copy link
Collaborator

Hi, @ZacSweers , thanks for the report. sorry I haven't found the cause but I can reproduce. Just wanted to add that assisted injection works in my small project with KSP2 and setting ksp.useKSP2=false in your repro and I got a similar error so this is probably not KSP2 specific.

@ZacSweers
Copy link
Author

Ahh good spot, I assumed it was KSP2 but I can't recall if I tested it fully on KSP1 👍

@ZacSweers ZacSweers changed the title [KSP2] Assisted injection appears to not work correctly in KSP2 Assisted injection appears to not work correctly in some cases Aug 13, 2024
@ZacSweers
Copy link
Author

Actually, I'm fairly certain this is the same issue as #4356 and I just need to remember debugging sessions better 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants