I’m working on a Flutter app that I imported from GitHub
But when I run it it does not work and gives this error
and when I create a new app it doesn’t show any problems
Open your Project’s android folder in Android Studio and from Menu go to Android Studio > Preferences > Build,Execution,Deployment > Build Tools > Gradle. Now here change Gradle JDK version from 1.8 to 11 (given in dropdown).
Just create a new flutter project in studio and then replace your lib folder and dependencies in pubspec.yaml if there are some. This could defend you from unexpected errors while working with old projects.
2
Answers
Open your Project’s
android
folder in Android Studio and from Menu go toAndroid Studio > Preferences > Build,Execution,Deployment > Build Tools > Gradle
. Now here changeGradle JDK
version from 1.8 to 11 (given in dropdown).Just create a new flutter project in studio and then replace your
lib
folder and dependencies inpubspec.yaml
if there are some. This could defend you from unexpected errors while working with old projects.