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

KSP dependency on generateProto - unable to build project due to KspTaskJvm issue #740

Open
bardale opened this issue Dec 1, 2023 · 1 comment

Comments

@bardale
Copy link

bardale commented Dec 1, 2023

I am using Kotlin 1.9.20 with Gradle 8.4 with id("com.google.devtools.ksp") version "1.9.20-1.0.14" in a gradle multimodule project and I am unable to build the project. Getting the errors below:

What went wrong:

Some problems were found with the configuration of task ':xxxxx:kspKotlin' (type 'KspTaskJvm').

   Gradle detected a problem with the following location: 'C:\Users...\ServiceGrpc.java'.
  
  Reason: Task ':xxxxx-rest:kspKotlin' uses this output of task ':xxxxx-rest:generateProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Possible solutions:

    Declare task ':xxxxx-rest:generateProto' as an input of ':xxxxx-rest:kspKotlin'.
    Declare an explicit dependency on ':xxxxx-rest:generateProto' from ':xxxxx-rest:kspKotlin' using Task#dependsOn.
    Declare an explicit dependency on ':xxxxx-rest:generateProto' from ':xxxxx-rest:kspKotlin' using Task#mustRunAfte
    r.

When setting explicit dependency as suggest, gradle is unable to find the task kspKotlin.

Thanks

@ejona86
Copy link
Collaborator

ejona86 commented Dec 1, 2023

It looks like those issues are just with your usage of ksp, and not related to this plugin. I'm not really able to help with that.

Unable to find the task is probably due to execution ordering. If you are able to configure it in an evaluateAfter {} block, then it confirms it is just an ordering problem.

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