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

'explodeCodeSourceDebug' uses this output of task 'generateDebugProto' without declaring an explicit or implicit dependency after Gradle update to 8.0.2 #683

Open
ivanalvarado opened this issue Mar 20, 2023 · 0 comments

Comments

@ivanalvarado
Copy link

We're experiencing the following error after updating gradle from 7.6.1 -> 8.0.2

A problem was found with the configuration of task ':my-library:generateDebugProto' (type 'GenerateProtoTask').
  - Gradle detected a problem with the following location: '/path/to/MyProject/my-library/build/generated/source/proto/debug'.
    
    Reason: Task ':my-library:explodeCodeSourceDebug' uses this output of task ':my-library:generateDebugProto' 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-library:generateDebugProto' as an input of ':my-library:explodeCodeSourceDebug'.
      2. Declare an explicit dependency on ':my-library:generateDebugProto' from ':my-library:explodeCodeSourceDebug' using Task#dependsOn.
      3. Declare an explicit dependency on ':my-library:generateDebugProto' from ':my-library:explodeCodeSourceDebug' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

This appears like a misconfiguration at the plugin level, but not entirely sure.

We've added a workaround by adding the following to the affected module:

afterEvaluate {
    tasks.forEach {task ->
        if (task.name.contains("explodeCodeSourceDebug")) {
            task.dependsOn("generateDebugProto")
        }
        if (task.name.contains("explodeCodeSourceRelease")) {
            task.dependsOn("generateReleaseProto")
        }
    }
}
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

1 participant