Unable to run on android device nor emulator ?
[RESOLVED] Gradle/Java compatibility error?
RESOLVED :
ON WINDOWS :
you can keep the latest version of android studio , but you have to downgrade your java version to JDK 17
Download https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-17replace files in Java binary at: C:\Program Files\Android\Android Studio\jbr
delete all files in jbr folder and replace them with the ones from JDK 17
run flutter doctor -v
make sure of the versions , reopen FF and now you can run your project
ON MACOS : Thanks to matchia
Install Java 17 via brew
brew install openjdk@17
Create a symbolic link for the Java 17
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
Add path to the symbolic link (I am using zsh, change to ~/.bashrc if you use bash)
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Configure Flutter to use the install Java 17
flutter config --jdk-dir /opt/homebrew/opt/openjdk@17
Restart Terminal and Android Studio
Run you AVD
flutter run