AndroidStudioでgradleがキャッシュが壊れているというエラー

さっきまでちゃんとビルドできていたプロジェクト、急に gradle がエラーを出してビルドできなくなった…。

Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

言われるままに AndroidStudio を終了して、念のために iMac を再起動して試みるも、やはり同じエラーが出て先に進めない。
ProjectをReBuildしたりしてもダメ!


というわけで、Google 先生に聞いてみたら教えてくれたのが以下のページ。
やはり安定の stackoverflow!

教えに従ってターミナルから {project dir}/.gradle/2.2.1 を削除。
念のために AndroidStudioを再起動してからプロジェクトを読み込んでビルドしてみると…無事エラーなしで終了!
良かった〜。