Device list doesn't shows in Android Studio using Flutter

喜夏-厌秋 提交于 2019-12-03 08:46:28

问题


I tried to develop app using Flutter(using Android studio IDE).Add flutter plugin & flutter SDK in studio and Everything is configured but emulator / real time device are not listed. Its shows error like "Unable to list devices: Unable to discover Android devices. Please run "flutter doctor" to diagnose potential issues"

Ref link : https://flutter.io/setup-windows/#android-setup

https://flutter.io/get-started/test-drive/#androidsstudio


回答1:


configure flutter in terminal to detect Android SDK and Android Studio:

$ flutter config --android-sdk /path/to/android/sdk
$ flutter config --android-studio-dir /path/to/android/studio

then restart Android Studio/Intellij. source: https://github.com/flutter/flutter-intellij/issues/2113#issuecomment-383412308




回答2:


May be there is no AVD's to list down. And if emulator runnig, intelliJ will grab it.

In Android Studio, you can create a AVD using AVD Manager or using Terminal. Here is how you can do that using Terminal,

First, go to the android sdk installed directory -> tools

and copy the path and in the terminal type cd and paste the path and press enter. Now yo are in the tools directory.

Next, using terminal type:

emulator -list-avds - to list created AVD's(You should be in tools directory to run this command).

If there is a device type emulator -avd <name>. else you can create a one:

type cd bin then,

Use:

avdmanager create avd -n name -k "sdk_id" [-c {path|size}] [-f] [-p path]

As a example:

avdmanager create avd -n Nexus -d 23 -k system-images;android-23;google_apis;x86

Then again go back to tools directory by typing cd .. and type emulator -list-avds. This command will list your created AVD.

To run a AVD type:

emulator -avd <name>

About AVD.




回答3:


Had the same problem after moving avd's to another disk.

I managed to solve by making ANDROID_HOME system variable to point to the android sdk path.



来源:https://stackoverflow.com/questions/49222658/device-list-doesnt-shows-in-android-studio-using-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!