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.
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
To Solve Could not open settings generic class cache for settings file Error If You are using java 12, 13 Or Any Version execpt Java 8 Then You just have to unistall java and reinstall java 8 version. By using java 8 will solve this error.
I also had this problem So I did install java 8 You might have Java 13 So install Java 8
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
mainly you have jdk16 i tried to install java 8 and set env to java 8 it worked for me
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
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.
I removed the JAVA_HOME path to the JAVA download and changed JAVA_HOME path to the following:
C:\Program Files\Android\Android Studio\jre
I am now coding
I GOT IT. No need no change your JDK version, follow the steps to resolve the issue:
That's it, i hope it will resolve your issue like it resolve mine.
Try it and give a feedback.
Try this!
Remove package android
from the top of settings.gradle. This helped me out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With