Could not open settings generic class cache for settings file '
Solution 1
I also had this problem So I did install java 8 You might have Java 13 So install Java 8
Solution 2
Java JDK 16 is the one that seems to lead to this issue try downgrading by downloading a lower version of JDK preferable JDK 8 or 11
To future individuals who will run to this error. Here is the link to download the JDK enjoy your coding experience don't forget to change the path too. https://www.oracle.com/java/technologies/javase-downloads.html
Solution 3
mainly you have jdk16 i tried to install java 8 and set env to java 8 it worked for me
Solution 4
Try installing the latest Gradle package gradle-7.1.1, if you are using Java JDK 16 installed. To do this open android/gradle/wrapper/gradle-wrapper.properties file and under distribution url, update the gradle version to 7.1.1 (or the latest). After that, inside your Flutter project directory, run the following command in the terminal:
cd android && ./gradlew
Solution 5
If this error occurs, this might because you have installed the latest JDK such as JDK 16. You download and install JDK 8 and uninstall JDK 16. Then restart the desktop/laptop and try launch and run flutter run again. It should be working fine.
Related videos on Youtube
lorandsouza
Updated on July 09, 2022Comments
-
lorandsouza almost 2 years
I reinstalled my android studio since the sdk was not found and so on. After re installing java jdk and android studio , everything worked well until I got an error saying 'Could not initialize class org.codehaus.groovy.runtime.InvokerHelper' which I solved by changing the Gradle version. And now the error is 'Type 'FlutterTask' property 'assets' is missing an input or output annotation.'
FAILURE: Build failed with an exception.
- What went wrong: Could not open settings generic class cache for settings file 'C:\Users\loran\ASProjects\xylophone-flutter\android\settings.gradle' (C:\Users\loran.gradle\caches\6.8.2\scripts\4mawlyb2l5e9tefyvnpxva1kg).
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 46s Exception: Gradle task assembleDebug failed with exit code 1
-
Sisir about 3 yearsCan you do a
./gradlew clean
and then open android studio and resync your gradle -
Einliterflasche almost 3 years@Sisir Where do I have to execute the command? In the IDE terminal didn't work for me.
-
Sisir almost 3 yearsThe
gradlew
file is present inside yourandroid
folder. So open a cmd, navigate toProjectRoot\android
and then execute teh command -
Einliterflasche almost 3 years@Sisir
gradlew clean
andgradlew
throws the same errorCould not open settings generic class cache for settings file
-
asish over 2 yearssetting java_home fixed error for me, org.gradle.java.home=/Applications/Android Studio 4.1 Preview.app/Contents/jre/Contents/Home
-
Einliterflasche almost 3 yearsThis didn't work for me. Where do I have to select the java edition?
-
Leonardo Costa almost 3 yearsIt worked for me, I had the jkd 16 installed, so I installed the jdk 8 and worked. The Google needs free itself from all that envolves the java. It's so boring setuping all. Tks man!
-
Smart Manoj almost 3 years@vishal Do you mean JDK 16?
-
13Tracso over 2 years@Sana'aAl-ahdal I am glad it did Enjoy your coding buddy.
-
Tony Lucas over 2 yearsthanks bro, life saver, and I want to point out that this website: mkyong.com/java/…" shows a way to deal with JAVA_HOME if you needed.
-
tingwai about 2 yearsgradle-7.4 for JDK 17
-
Bradley Kirkland about 2 yearsWhen providing support it's always better to provide more detailed instructions + AVAST is unlikely to have an issue as it's not been specified to be used by the stackoverflower