Background: I've been fighting with Studio/Gradle for a day or so at this point; there were initially multiple PEBKAC errors (namely permissions and resource limits) that have since been resolved. Unfortunately the google-fu has failed me for this current error.
The error specifically occurred attempting to complete ./gradlew clean which did not complete successfully; it failed about 30s in.
I temporarily 'fixed' the problem by blowing away the offending git repo and cloning it anew. I discovered the error seems to occur only on a specific branch (ie, switch to x_branch, run 'clean project,' receive error), but have not yet figured out why. Attempting to switch to another branch or back to master after receiving the error does not revert gradle back to a working state; the error remains.
Error:
Gradle project refresh failed: Error: Already finished
System env: Android Studio 3.1 // Gradle version 171.4250
My question(s): Has anyone seen this error before? What does this error mean and how do I prevent it from re-occurring?
解决方案
Restarting Android studio :
File > Invalidate Caches/Restart worked for me