Skip to content

KSP2 generation of root Component is broken in 1.6.0 #200

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

Open
Jacks0N23 opened this issue May 8, 2025 · 3 comments
Open

KSP2 generation of root Component is broken in 1.6.0 #200

Jacks0N23 opened this issue May 8, 2025 · 3 comments

Comments

@Jacks0N23
Copy link

Jacks0N23 commented May 8, 2025

I have a large AppComponent that implements a significant number of *Dependencies interfaces. Previously (before version 1.6.0), everything resolved correctly, but now it seems to depend heavily on the order in which these interfaces are declared.

For example:
My AppComponent includes modules that provide dependencies, and the component itself implements both ADependencies and BDependencies.

ModuleA provides someA(): SomeA

ModuleB provides someB(): SomeB

In ADependencies, I request someB

Now, if I define AppComponent like this:

AppComponent : ADependencies, BDependencies

Yatagan fails with the following error:

Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler output below.
  /Users/me/StudioProjects/my-project/app/build/generated/ksp/debug/java/app/my/project/di/core/Yatagan$AppComponent.java:XXX: error: Yatagan$AppComponent is not abstract and does not override abstract method someB() in ADependencies

However, if I reverse the order of interface declarations, everything works fine and Yatagan proceeds without issue.

Unfortunately, in real-world projects, managing the order of more than fifty interfaces manually is not very practical — and there’s no guarantee it will always resolve the problem.

Worth noting: this issue doesn’t occur with KSP 1, where everything works as expected.

@bacecek
Copy link
Collaborator

bacecek commented May 9, 2025

Thanks for the report.
Looks pretty the same as #189, but here is the problem with methods. We will take a closer look.

@bacecek
Copy link
Collaborator

bacecek commented May 9, 2025

Can you please tell me what language all the code you listed is written in?

@Jacks0N23
Copy link
Author

@bacecek full kotlin project

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