Flutter not detecting device / “flutter devices” No devices detected

If we tried to run “flutter devices” command to identify make sure we are ready to connect our device with flutter for deploying our applications, it returned as,

$ flutter devices
No devices detected.

Run 'flutter emulators' to list and start any available device emulators.

Or, if you expected your device to be detected, please run "flutter doctor" to diagnose potential issues, or visit https://flutter.dev/setup/ for troubleshooting tips.

• Device B2NGAA8831702707 is not authorized.
You might need to check your device for an authorization dialog.

If you are setting up Flutter development environment on Ubuntu, and as mentioned in documentation, you will need to verify that everything is fine with command “flutter doctor”, but sometimes ( as we seen during our first time setup ) you may see an error like as below,

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Android Studio (version 3.4)
[!] Connected device

! Doctor found issues in 1 category.

This means in our setup eveything went fine, but the last step seen an issues as shown with exclamatory sign [!] , if we check little deeper to identify what has been happening,

$ flutter doctor -v
[  +35 ms] executing: /home/devlab/Android/Sdk/platform-tools/adb devices -l
[   +9 ms] Exit code 0 from: /home/devlab/Android/Sdk/platform-tools/adb devices -l
[        ] List of devices attached
           B2NGAA8831702707       unauthorized usb:1-2 transport_id:1
[  +13 ms] No devices detected.

As we can see above, flutter is using Android SDK tools sdb instead of your ubuntu installed adb, hence lets see how it returns,

$ /home/devlab/Android/Sdk/platform-tools/adb devices -l
List of devices attached
B2NGAA8831702707       unauthorized usb:1-2 transport_id:1

Solution

$ /home/devlab/Android/Sdk/platform-tools/adb kill-server
$ sudo /home/devlab/Android/Sdk/platform-tools/adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
B2NGAA8831702707	device
<pre> $ flutter devices
1 connected device:

mymobilename • B2NGAA8831702707 • android-arm64 • Android 9 (API 28) </pre>

Now, if we run “flutter doctor” it should not show any error as,

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale en_IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

• No issues found!
Fix Failed To Connect - Network Err... x
Fix Failed To Connect - Network Error in Genshin Impact Mobile

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux