Flutter: No connected devices error solution
Flutter shows a No connected device found: Please connect a device error message or No supported devices connected error message basically when you have not connected a physical device or have not launched an Android Emulator or iOS simulator. Since Flutter supports both physical devices and emulators, we will show you how to set up and run Flutter app on both of them.
If Virtual Device (Emulator) already present
- First, check if any Android virtual devices are already present in Android Studio by clicking the dropdown menu as shown in the image above. If any devices are present, it will be shown as Android SDK built for ..
- Click the Android SDK built for .. option to launch the emulator
- Once the emulator is launched click the play button or launch the app by flutter run command from the terminal
If Virtual Device (Emulator) is not present
- In the android studio, go to Tools>Android>AVD Manager
- Tap Create Virtual Device button
- Choose the device you want to install and click Next
- Choose the Android API version you want on your virtual device and click Next
- Choose the default orientation and click Finish. The virtual device will be installed
- Click the PLAY button below the action column to launch the emulator
- Once the emulator is launched click the play button or launch the app by "flutter run" command from the terminal
Android Physical Device
- On your physical device, go to Settings>System>About phone
- Down below the options, you could see an option Build Number. Tap the Build number 7 times to enable Developer Options.
- Now go back to Settings>System and choose Developer Options (some times under Advanced tab) and enable USB debugging
- Connect to your desktop via USB
- Once connected, the device will be visible under the Devices dropdown menu in Android Studio. Choose the device and click the play button or launch the app by "flutter run" command from the terminal.
- Make sure you have XCode installed on you Mac
- Select the iOS simulator from the devices dropdown menu
- Once the simulator is launched click the play button or launch the app by flutter run command from the terminal
iOS Physical Device
- Connect your device via USB to your Mac
- Choose the device from the devices dropdown menu
- Click the play button or launch the app by "flutter run" command from the terminal
If device is not present in the devices dropdown list
- Locate and open the ios/Runner.xcworkspace/contents.xcworkspacedata in Android studio
Click open iOS Module in XCode option at the top right of Android Studio
In XCode click Runner and add the device as shown in the image below. Here Abin's iPhone is my device.
Add team name as shown in the image below and click the Play button on XCode to run the app.
How to display images from internet in Flutter?
Step by step guide on how to display images from internet in Flutter
How to display asset images in Flutter?
Step by step guide on how to display asset images in Flutter
How to Make Glowing Play Button Animation in Flutter?
This widget can be used in a UI as play button for a music player, start button for games or even as loading indicator.