Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1126 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Device not applicable for the "main.dart" configuration ,

#1
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][1]][1]


I already installed sdk .

My android devices android version is 7.0
[![my android devices android version is 7.0][2]][2]


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:

[To see links please register here]

On first launch it will assist you in installing the Android SDK components.
(or visit

[To see links please register here]

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

[To see links please register here]


[!] 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

[To see links please register here]


[!] Connected device
! No devices available

! Doctor found issues in 4 categories.
```
[1]:

[2]:
Reply

#2
Thats warning said "**Android SDK location should not contain whitespace**". There is a whitespace character in `Tamim Mustofa`.

You can move sdk folder to new folder like `D:\Android\Sdk`, where there is no space or other whitespace character in the path.
Change Android Sdk Location address in Android Studio.
and add variabel `ANDROID_HOME` in your Environment Variable: System Variable. with `D:\Android\Sdk` as variable value
Reply

#3
This seems to be the problem:

[X] Android toolchain - develop for Android devices
-> ANDROID_HOME = D:\Android\Sdk but Android SDK not found at this location.
Since you said that you added the Android SDK to your D directory, you could just add `D:\Android\sdk\tools` and `D:\Android\sdk\platform-tools` to your PATH environment variable. This is how you can add it to your Path enviroment variable:

[To see links please register here]

Reply

#4
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][1]


[1]:
Reply

#5
Go to Tools > SDK Manager > SDK Tools and check Google USB Driver. Restart Android Studio.
All this worked for me, might be helpful to someone.
Reply

#6
Some SDK versions of Flutter may cause the problem of not being able to find the device or simulator.You can switch the SDK version to the stable version.
I had a same problem on my Mac with the Flutter version 1.17.4, and it worked after I went back the version to 1.17.3.

Version rollback step:

1.Open the [Flutter GitHub repository][1].

2.Click 'master' button to open the switch menu. And the click 'Tags' item.

3.Search the stable version tag(e.g. 1.17.3).

4.Open the tag and click the commits.

5.Copy the top commit id.

6.Run the command 'git reset --hard $(commit id)' in the Flutter directory.

7.Restart the Android Studio.

[1]:

[To see links please register here]

Reply

#7
It seems like this problem may have a lot of different symptoms, but for me to be able to run my flutter app in my android device, I had to set the **android SDK** in the `Project Structure` modal.

You can open the `Project Structure` modal by right clicking on the project **root** folder (in the file tree) > `Module Settings` > `Project` and set the `Project SDK`:

Mine is like this:
[![enter image description here][1]][1]

If somehow the `Project` tab is disabled or in a weird state, I recommend you to close android studio, delete the project `.iml` file and the `.idea` folder, reopen the project in AS (open existing project) and set the android SDK in the project structure like I've described above. At least this is what I did and it fixed for me, so I hope this answer help someone.

[1]:
Reply

#8
I've had the same issue and what worked for me is to re-import the project.

`File > Close Project`, go to the project's directory and delete the `.idea` folder.
Then `File > Open...` and re-open the project.

Open `Project Structure`, you can set the project's SDK with what you have.
[![enter image description here][1]][1]

After this, I was able to run `main.dart` with the emulator.
[![enter image description here][2]][2]


[1]:

[2]:
Reply

#9
It took me a while to find `Project` that the others are seeing, it's probably due to the updated version of Android Studio. I found it on `External Libraries` on the left panel and under it, right click on the `Android API (NN) Platform` > `Open Library Settings` > `Project` under `Project Settings` and on the right panel, change the Android API. I had `<No SDK>`, see screenshot.

[![enter image description here][1]][1]


[1]:
Reply

#10
All you need is to run **Android Studio** as Administrator.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through