I keep getting this Gradle error related to the K/...
# javascript
e
I keep getting this Gradle error related to the K/JS
copyResourcesJs
task, when invoking
gradlew build
Anyone ever seen the same?
Copy code
* What went wrong:
Some problems were found with the configuration of task ':my-project:copyResourcesJs' (type 'Copy').
  - Gradle detected a problem with the following location: 'C:\Users\edoardo.luppi\IdeaProjects\client-example\proto-example\modules\my-project'.
    
    Reason: Task ':my-project:copyResourcesJs' uses this output of task ':my-project:compileKotlinJs' 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:
      1. Declare task ':my-project:compileKotlinJs' as an input of ':my-project:copyResourcesJs'.
      2. Declare an explicit dependency on ':my-project:compileKotlinJs' from ':my-project:copyResourcesJs' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-project:compileKotlinJs' from ':my-project:copyResourcesJs' using Task#mustRunAfter.
    
    For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
  - Gradle detected a problem with the following location: 'C:\Users\edoardo.luppi\IdeaProjects\client-example\proto-example\modules\my-project'.
    
    Reason: Task ':my-project:copyResourcesJs' uses this output of task ':my-project:compileCommonMainKotlinMetadata' 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:
      1. Declare task ':my-project:compileCommonMainKotlinMetadata' as an input of ':my-project:copyResourcesJs'.
      2. Declare an explicit dependency on ':my-project:compileCommonMainKotlinMetadata' from ':my-project:copyResourcesJs' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-project:compileCommonMainKotlinMetadata' from ':my-project:copyResourcesJs' using Task#mustRunAfter.
    
    For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
  - Gradle detected a problem with the following location: 'C:\Users\edoardo.luppi\IdeaProjects\client-example\proto-example\modules\my-project'.
    
    Reason: Task ':my-project:copyResourcesJs' uses this output of task ':my-project:generateProjectStructureMetadata' 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:
      1. Declare task ':my-project:generateProjectStructureMetadata' as an input of ':my-project:copyResourcesJs'.
      2. Declare an explicit dependency on ':my-project:generateProjectStructureMetadata' from ':my-project:copyResourcesJs' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-project:generateProjectStructureMetadata' from ':my-project:copyResourcesJs' using Task#mustRunAfter.
    
    For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
  - Gradle detected a problem with the following location: 'C:\Users\edoardo.luppi\IdeaProjects\client-example\proto-example\modules\my-project'.
    
    Reason: Task ':my-project:copyResourcesJs' uses this output of task ':my-project:transformCommonMainDependenciesMetadata' 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:
      1. Declare task ':my-project:transformCommonMainDependenciesMetadata' as an input of ':my-project:copyResourcesJs'.
      2. Declare an explicit dependency on ':my-project:transformCommonMainDependenciesMetadata' from ':my-project:copyResourcesJs' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-project:transformCommonMainDependenciesMetadata' from ':my-project:copyResourcesJs' using Task#mustRunAfter.
    
    For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
  - Gradle detected a problem with the following location: 'C:\Users\edoardo.luppi\IdeaProjects\client-example\proto-example\modules\my-project'.
    
    Reason: Task ':my-project:copyResourcesJs' uses this output of task ':my-project:allMetadataJar' 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:
      1. Declare task ':my-project:allMetadataJar' as an input of ':my-project:copyResourcesJs'.
      2. Declare an explicit dependency on ':my-project:allMetadataJar' from ':my-project:copyResourcesJs' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-project:allMetadataJar' from ':my-project:copyResourcesJs' using Task#mustRunAfter.
    
    For more information, please refer to <https://docs.gradle.org/8.3/userguide/validation_problems.html#implicit_dependency> in the Gradle documentation.
h
What's the definition of
copyResourcesJs
?
e
@hfhbd that's a good question, I was not able to get to the definition, no idea where it's defined
Literally I can't find it
Let me see if removing the plugin gets rid of the errors.
Yup. @goncalossilva FYI
g
Thanks @Edoardo Luppi! Is this OSS, so I can repro?
e
@goncalossilva hey! Had missed the message, I'll try to repro since my project is not open sourced.
But could it be that the task simply don't specify the necessary inputs and outputs for incrementality?
g
I'd appreciate it! That's what it means, but it may not happen in all setups. I'm using this in a number of different libraries at work and haven't seen it. It may be a versioning problem. What library version are you using, and what Kotlin version?
e
I'm using your latest (0.4.0 iirc) and 1.9.20 Beta2
👍 1
With Gradle 8.3
g
I haven't tried 1.9.20 yet, but now I will. Thanks for sharing. 😊
gratitude thank you 1
e
I need to repro a K2 issue so I'll try to repro this one too next week anyway