Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Device not applicable for the "main.dart" configuration ,

Tags:

I use Android Studio as my IDE in coding Flutter. I was able to create 2 projects before this and it worked absolutely fine. I had to clone a repo from Github. The IDE said to get config. I did that then this happened. enter image description here

I already installed sdk .

My android devices android version is 7.0 my android devices android version is 7.0

Flutter Doctor result:

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)     • Flutter version 1.12.13+hotfix.8 at C:\src\flutter\flutter     • Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800     • Engine revision e1e6ced81d     • Dart version 2.7.0  [X] Android toolchain - develop for Android devices     X Unable to locate Android SDK.       Install Android Studio from: https://developer.android.com/studio/index.html       On first launch it will assist you in installing the Android SDK components.       (or visit https://flutter.dev/setup/#android-setup for detailed instructions).       If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.       You may also want to add it to your PATH environment variable.   [√] Android Studio (version 3.6)     • Android Studio at C:\Program Files\Android\Android Studio     • Flutter plugin version 44.0.2     • Dart plugin version 192.7761     • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)  [!] Android Studio     • Android Studio at C:\Program     X Flutter plugin not installed; this adds Flutter specific functionality.     X Dart plugin not installed; this adds Dart specific functionality.     X android-studio-dir = C:\Program     X Android Studio not found at C:\Program     • Try updating or re-installing Android Studio.     • Consider removing your android-studio-dir setting by running:       flutter config --android-studio-dir=  [!] VS Code     • VS Code at C:\Users\Tamim Mostafa\AppData\Local\Programs\Microsoft VS Code     X Flutter extension not installed; install from       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter  [!] Connected device     ! No devices available  ! Doctor found issues in 4 categories. 

I also tried changing the directory an using folder with no white space. I moved the Sdk folder to D:\Android\Sdk. flutter doctor -v:

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)     • Flutter version 1.12.13+hotfix.8 at C:\src\flutter\flutter     • Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800     • Engine revision e1e6ced81d     • Dart version 2.7.0  [X] Android toolchain - develop for Android devices     X ANDROID_HOME = D:\Android\Sdk       but Android SDK not found at this location.  [√] Android Studio (version 3.6)     • Android Studio at C:\Program Files\Android\Android Studio     • Flutter plugin version 44.0.2     • Dart plugin version 192.7761     • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)  [!] Android Studio     • Android Studio at C:\Program     X Flutter plugin not installed; this adds Flutter specific functionality.     X Dart plugin not installed; this adds Dart specific functionality.     X android-studio-dir = C:\Program     X Android Studio not found at C:\Program     • Try updating or re-installing Android Studio.     • Consider removing your android-studio-dir setting by running:       flutter config --android-studio-dir=  [!] VS Code     • VS Code at C:\Users\Tamim Mostafa\AppData\Local\Programs\Microsoft VS Code     X Flutter extension not installed; install from       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter  [!] Connected device     ! No devices available  ! Doctor found issues in 4 categories. 
like image 298
Momin mostafa Avatar asked Mar 26 '20 07:03

Momin mostafa


1 Answers

It solved my problem:

  1. Make sure Flutter plugin is installed in android studio, you can install the plugin from file > setting > plugin
  2. choose flutter SDK path from File > setting> Language & Framework > flutter.

For my case the flutter sdk path was D:/flutter

like image 99
Sayed Ahmed Avatar answered Oct 19 '22 22:10

Sayed Ahmed