22

I have an Android tablet and an old Linux notebook where I developed a program for months, no glitches.

Then I got a new Linux notebook, installed Android Studio, and tried to plug in the Android tablet. The tablet never shows up in the target list; it just says, "Unknown Device." When I select "Troubleshoot device connections," the wizard displays the ID of the tablet, with the cryptic message "Device is currently in the unknown state."

Turning the tablet's "USB debugging" option off and on again does not fix the problem. When I unplug and replug the USB, the tablet chimes, but does not put up a requestor asking if I accept this debugging connection.

Running adb devices returns:

$ adb devices
List of devices attached
adb server version (41) doesn't match this client (39); killing...
* daemon started successfully
B007904026445   no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]

Any tips?


Unplugging and plugging in the USB just one more time finally gave me the requestor on the tablet asking for permission to be debugged by this notebook. End of crisis.

An actual answer how to get that requestor without USB cable abuse would be nice...

Phlip
  • 5,253
  • 5
  • 32
  • 48

8 Answers8

52

while connecting Android phone to computer Select 'File transfer' option in 'Use USB for ' Dialog. this will solve the issue.Tested.

Suraj Raut
  • 531
  • 4
  • 3
  • 2
    I have Pixel 4a with Android 11. This solution worked for me. For everyone's information, after giving the permission on the dialog, changing back to 'No data transfer' option stop the permission. Need to keep it on 'Fire transfer/Android Auto' option. – krishh Jan 28 '21 at 16:07
  • Well, I am not facing this issue in Windows. Only in my Fedora system which is in dual boot. Also, Android Studio is not able to provide Intel Hardware Acceleration in the Fedora system, but does in Windows. Maybe, some issue because of dual booting in a Windows locked system. Basically, in Windows I am able to see the Pixel 4a in Android Studio with either of 'Use USB for...' option. – krishh Jan 29 '21 at 09:27
  • Worked for OnePlus 3T, thanks! – ArieDov Sep 28 '21 at 06:37
  • I have raised the problem and this possible solution as an issue: https://issuetracker.google.com/issues/233241793?pli=1 – PJTraill May 20 '22 at 08:59
  • Confirmed on a Pixel 6a. My guess is that a brand new device defaults to "No data transfer" which means "not even ADB", maybe? – lack Jul 28 '23 at 01:26
3

Select Revoke USB debugging authorizations to revoke access to all computers you've previously authorized (Settings > System > Developer Options > Debugging).

See more in this post

Community
  • 1
  • 1
quangkid
  • 1,287
  • 1
  • 12
  • 31
3

I ran into this issue when connecting a Pixel 2 XL running Android 11 via USB (with USB debugging on). The solution here worked for me:

Run

sudo adb kill-server

and then

sudo adb start-server

then connect your device turn Debugging on and type

adb devices

again. After doing this, the Pixel 2 showed up in the list of devices in Android Studio.

Jacob Stern
  • 3,758
  • 3
  • 32
  • 54
  • as I commented elsewhere, ever since I wrote a script to run my test batch from the command line (`adb -s 424242 shell am instrument ...our.package/androidx.test.runner.AndroidJUnitRunner` etc), the wire drops about once an hour. All these fixes don't work, and I must manually unplug and replug the USB to get the device back. Serves me write for trying to run a test batch! – Phlip Oct 07 '20 at 16:17
2

I came across the same issue. By scanning for devices in troubleshooting connections after installing adb, it showed me directly the request for pairing the device. I have similar set up and One Plus 3

bad_locality
  • 135
  • 2
  • 12
2

https://developer.android.com/studio/run/device

  • add yourself to the plugdev group: sudo usermod -aG plugdev $LOGNAME
  • install sudo apt-get install android-sdk-platform-tools-common
  • log out and log in again for the group changes to take effect

If it's still not working, try to:

  • disable and enable "USB-Debugging" on your developer settings of your Android phone

If it's still not working a not so great workaround is restarting the adb server. Not so great, because adb should not run as sudo:

  • cd / && sudo find -name "adb" # ADB_PATH
  • sudo ADB_PATH/adb kill-server
  • sudo ADB_PATH/adb start-server
  • sudo ADB_PATH/adb devices
hb0
  • 3,350
  • 3
  • 30
  • 48
1

This can happen if you have Chrome inspect or other similar software hanging

code-e
  • 51
  • 6
1

in my case I had this error because I was connecting to a HUB USB.

Cristian
  • 11
  • 1
1

It also happened to me, when I tried to connect my Android Phone in Android Studio.

On my Phone i got the message "USB debugging connected" but the pop-up Window that asks for "allow USB debugging" never showed up. Also in Android Studio the code wasn't uploadable to my Phone. I also got "Device is currently in the unknown state" in Troubleshoot Device Connections.

The Problem was: my Settings (Connected Devices > USB Preferences) on my Phone were set to "No data Transfer".

I had to enable "File Transfer"

kriska
  • 11
  • 1
  • correct. Other chatter on this topic says that silly File Transfer option does it. Which is ironic because modern smartphones can't transfer files anymore anyway. – Phlip Feb 18 '23 at 04:06
  • there's also a file in ~/.android/ to delete if adb becomes confused about what is authorized – Phlip Feb 18 '23 at 21:22