Everything was working fine untill i tried to run a flutter code i bought from Codecanyon and started having this issue, which i tried so many fix which i saw online and will list them bellow, but now even the new flutter projects i create now give same issue
Steps:
i have installed java 11 and 16 as well
then tried to change the defaul jdk version using
export JAVA_HOME=`/usr/libexec/java_home -v 11.0.17`
and
export JAVA_HOME=$(/usr/libexec/java_home -v 11)
then when i run java -version
on the terminal i get the report bellow
which i believe means i have succefuly changed it (I haved tried using bash, switched to Zsh and now back to bash) but it’s still not working
Also tried to change it via the IDE from some solutions i saw here on stackOverflow but from the android-studio> Prefrences> Build, Execution, Deployment> Gradle the section is not showing until i try the File> Project Structure> Project and select JDK 11
Still not working, even installed the latest version of Android Studio, still didn’t fix the issue, and i had to install the old version again since my emulator stopped working after the update
Have been battling this for some weeks to a month now, have checked multiple solutions here and on github but still can’t get a solution that works
3
Answers
After Trying for weeks what later worked for me was going to Project_File>Android>build.gradle file and changing
To:
and i just run
./gradlew clean build
and then run the project, everything now working fineThanks All
search for
gradle
in preferences and then select the correct Gradle JDKThe current flutter version does not support this project. You can open the Gradle configuration file embedded in the current flutter version to view the Gradle information.
open android>app>build.gradle line 24
You will see the gradle version used by the current flutter version and current java compile version