-1

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

Yasser BK
  • 23
  • 4
  • Have you tried to run flutter doctor on terminal/command prompt? – Muhammad Usama Siddiqui Mar 27 '22 at 10:42
  • it gives this problem: [!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) X cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. – Yasser BK Mar 27 '22 at 10:46
  • Use this (https://stackoverflow.com/a/71527159/13378076) to fix the problem raised by flutter doctor. – Muhammad Usama Siddiqui Mar 27 '22 at 11:10
  • Does this answer your question? [Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"](https://stackoverflow.com/questions/66980512/android-studio-error-android-gradle-plugin-requires-java-11-to-run-you-are-cur) – Martin Zeitler Mar 27 '22 at 11:19

2 Answers2

0

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).

enter image description here

0

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.

rozerro
  • 5,787
  • 9
  • 46
  • 94