I had this error with a similar setup, but couldn’t solve it with the previous answers. Resolved it by doing this.
- File > Setting (Ctrl+Alt+S)
- Build, Execution, Deployment > Build Tools > gradle
- Run Tests using: Intellij IDEA
All credit to: https://linked2ev.github.io/devsub/2019/09/30/Intellij-junit4-gradle-issue/.