I have recently updated my Android Studio from Koala to Ladybug and started facing this gradle issue. I have also updated my JDK version to JDK 17. Please help.
FAILURE: Build failed with an exception.
- What went wrong: Could not open settings generic class cache for settings file 'C:\wits_flutter_mobile\android\settings.gradle' (C:\Users\kirankumar.maharana.gradle\caches\7.6.1\scripts\11989y3l7lwkyvb4bdiwxejog).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
- 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
BUILD FAILED in 1s
I have recently updated my Android Studio from Koala to Ladybug and started facing this gradle issue. I have also updated my JDK version to JDK 17. Please help.
FAILURE: Build failed with an exception.
- What went wrong: Could not open settings generic class cache for settings file 'C:\wits_flutter_mobile\android\settings.gradle' (C:\Users\kirankumar.maharana.gradle\caches\7.6.1\scripts\11989y3l7lwkyvb4bdiwxejog).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65
- 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 1s
Share Improve this question edited Jan 20 at 12:28 KiranMaharana1224 asked Jan 20 at 12:17 KiranMaharana1224KiranMaharana1224 112 bronze badges 4- If you have more than one Android studio installed on your system then remove other version and keep only one version. After that, remove build folder of flutter project and run again. – DroidFlutter Commented Jan 20 at 12:26
- I have only one version of Android Studio in my system @DroidFlutter – KiranMaharana1224 Commented Jan 20 at 12:29
- Have you tried to invalidate cache and restart Android Studio? – Shashanth Commented Jan 20 at 16:01
- Yes I tried tinvalidate cache and restart @Shashanth – KiranMaharana1224 Commented Jan 21 at 3:58
1 Answer
Reset to default 0Change java version of project via gradle.properties
org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
or globally in bashrc file
export JAVA_HOME="/Users/mac/Library/Java/JavaVirtualMachines/jbr/Contents/Home"
change as per your system path