Question: **Here is the error:**

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'E:\proj\android\settings.gradle' (C:\Users\patel.gradle\caches\6.7\scripts\1fnwrr8g4rohfp291nvlxj5qe).

> 
> BUG! exception in phase 'semantic analysis' in source unit '*BuildScript*' Unsupported class file major version 60
> 
> 
> 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>

BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1

---

I already change JDK 16 to 8 and update Gradle version.

Answer: 
I added this line to **./android/gradle.properties** for **OSX** `org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home`
Android Studio changed their file path for the jre so I think this will go away once flutter fixes with a new version
I added this line to `./android/gradle.properties` for `OSX`:

```
org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home

```

This is what worked for me.