Here’s the discussion for the bug. There’s a workaround. https://issues.gradle.org/browse/GRADLE-1912 And here’s the bug reporting 5 years ago. And it’s never fixed.