41

The commands flutter devices and adb devices are giving me the same error:

adb devices
List of devices attached
FA69H0308097    no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]

flutter doctor detects my old Nexus 5, but, with my Pixel phone, I get the permission error. Pixel phone is in debug mode. The output from flutter doctor on Ubuntu 7.10 is

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Linux, locale en_AU.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[✓] VS Code (version 1.21.0)
Error retrieving device properties for ro.product.cpu.abi:
error: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
See [http://developer.android.com/tools/device.html] for more information

[✓] Connected devices (1 available)

How can I enable my computer to access my Pixel phone?

Zoe
  • 27,060
  • 21
  • 118
  • 148
sebe
  • 1,615
  • 2
  • 12
  • 10
  • If someone has the same problem and the below answers didn't work (as it not worked for me), try [this solution](https://stackoverflow.com/a/60604852/5023964) – leosbrf Mar 09 '20 at 16:38
  • Anyone google this title please refer [this question](https://stackoverflow.com/questions/28704636/insufficient-permissions-for-device-in-android-studio-workspace-running-in-opens) too. Basically get Pixel vendor id from `lsusb` is 18d1 then write `SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"` into `/etc/udev/rules.d/22-android.rules`. – 林果皞 Jan 25 '22 at 04:36

9 Answers9

114

With my Pixel phone plug into the computer, in the notification shade, I changed it from USB "Charge this phone" to "PTP" (Picture Transfer Protocol).

I then ran flutter doctor and my Pixel asked me to "Allow USB debugging" for my computer, I ticked the box to "Always allow from this computer".

I found the solution via https://github.com/flutter/flutter/issues/10330, which pointed to another Stack Overflow post.

nbro
  • 15,395
  • 32
  • 113
  • 196
sebe
  • 1,615
  • 2
  • 12
  • 10
  • 1
    See also: [https://developer.android.com/studio/debug/dev-options](https://developer.android.com/studio/debug/dev-options). – nbro Sep 06 '18 at 16:48
  • You are Great, Working fine when I send files between Android to Linux with adb – Indacochea Wachín May 15 '20 at 22:16
  • 1
    On my Moto G22 phone, Android 12, I had to set **Use USB for** to **File transfer** (under **USB Preferences**). For some reason it was set to No data transfer on my phone. – dan-gph Jul 04 '22 at 07:23
18

change the usb connection options to PTP. That worked for me.

8

The best solution and what worked better for me is to install adb from the ubuntu package. This gives you a community-maintained default set of udev rules for all Android devices.

example:

 sudo apt-get install adb
Mayur Karmur
  • 2,119
  • 14
  • 35
alBaryonic
  • 89
  • 1
  • 1
4

I know you may have solved the problem/issue by now but I would just have to post this here for linux guys that may need help.

one thing I really love is a complete guide.

  1. Open terminal and type
    sudo apt update
  1. After the update is done, you would need to install adb
    sudo apt-get install adb
  1. Then you would have to run this last command
    sudo usermod -aG plugdev $LOGNAME
  1. Invalidate cache and restart android studio

If you are done with this four steps the permission issue would have been solved but you may still need to change the USB connection port to another port. Thanks.

Rahul Bhobe
  • 4,165
  • 4
  • 17
  • 32
Nkenyor
  • 29
  • 6
3

Error 1 retrieving device properties for ro.product.cpu.abi: error: insufficient permissions for device: user deepanshu is not in the plugdev group See [http://developer.android.com/tools/device.html] for more information

This Error may be changed when you change your USB mode from "Charge Only" to "Files". Thank you.

Deepanshu
  • 169
  • 6
2

I don't get the notification shade others are mentioning. The alternative is from Settings, search for 'USB preferences', select it and choose the 'PTP' radio button.

user2233706
  • 6,148
  • 5
  • 44
  • 86
1

With my Vivo phone plugged into the laptop, in the notification shade, I changed it from USB "Charge Only" to "FTP" (File Transfer Protocol). You can use either "FTP" (File Transfer Protocol) or "PTP" (Photo Transfer Protocol).

Adeel Nazim
  • 640
  • 6
  • 17
0

I do not know the reason, but connecting my phone on the USB 3 port solved this for me.

i found this here: https://askubuntu.com/questions/376815/how-to-connect-mtp-android-device-to-ubuntu-13-10

Michael Wallace
  • 402
  • 3
  • 9
0

For me this helped: https://askubuntu.com/a/1182597 Basically had to assign a+r permission to .rules file

gsingh
  • 91
  • 1
  • 4