How to clear build cache for a specific task?

What seems to be happening here is that there is some missing input to the task(s) in question, which means the build cache is serving you incorrect artifacts.

I suggest the following next steps:

  1. The next time your build fails in this way, publish a build scan from it. If you don’t have build scans enabled for all builds, you can publish the scan from the most recent build with the buildScanPublishPrevious task. See here for more documentation on publishing build scans. Once published, save the link to that scan.
  2. Now, re-run the build with --no-build-cache --scan. This will disable the build cache and publish a scan. Save the link.
  3. Reply to this message with both scans.