In my case, running gradlew --stop or invalidating the cache didn’t resolve the issue. However, restarting my Mac fixed it.