1

I'm running Android Studio Arctic Fox 2020.3.1 Patch 2 on my Dell XPS 13-9370 running Linux Ubuntu Ubuntu 20.04.3 LTS and when I try to connect either of my two Pixel 2s via USB, Studio fails to see them. I have USB debugging enabled and have tried setting Default USB configuration to both File transfer and PTP, to no effect. I also tried swapping USB cables and all the other steps described in the Android Studio Troubleshoot Device Connections.

I should mention that I have no problem connecting Studio to my Samsung Tab A running Android 11, or to any of the emulated devices. They all connect just fine. When I plug the USB cable into the Pixel 2s, I don't even get the permission prompt, even after revoking USB permissions.

I've been knocking my head against a wall on this for a couple of days now, trying out every relevant suggestion I've found on Stack Overflow. I used to have no problem connecting my two Pixel 2 devices up until a few days ago. The problem also occurs on the previous version of Android Studio. I thought it might have something to do with several new third-party apps I installed, but I forced stop them, rebooted the device and still the problem remains.

FractalBob
  • 3,225
  • 4
  • 29
  • 40
  • I have also been having several non related issues with the new android studio Arctic Fox. mine mainly concern the IDE not recognizing code across flavours or autocomplete somtimes not working. I think it will go down in history as the windows Vista of Android studio releases XD. have you tried reverting back to Android Studio 4.2? Thanks btw reading this just convinced me not to install the latest patch XD – quealegriamasalegre Oct 17 '21 at 23:22
  • btw have you tried any other apps that use the ADB of your device? have you explored your files on your pixel successfully? there is an app called scrcpy that mirrors your device on a screen. maybe try it out to see if the issue is with android Studio or with your device. https://github.com/Genymobile/scrcpy. maybe also try on a different PC if you can – quealegriamasalegre Oct 17 '21 at 23:54
  • Try installing different USB drivers? Delete all the old ones and start fresh. – Darkman Oct 18 '21 at 08:53
  • Since the problem started with the previous version of Android Studio, I doubt it has anything to do with Arctic Fox. Also, I have no problem mirroring the device screen to Chromecast. Finally, I tried creating a wireless connection between Studio and both my Pixel 2s; that also fails. – FractalBob Oct 19 '21 at 05:03
  • https://stackoverflow.com/a/54242634/549372 – Martin Zeitler Oct 22 '21 at 22:44
  • Is there any Logcat/terminal output when you to run your ap on your pixel2s? or does android studio not even recognize them? when you say "pemission prompt" do you mean the typical debugging prompt that asks you wether you want to explore your phones files on your pc or the prompt asking wether you want to install the app. did you already try Martins and Darkmanns suggestions – quealegriamasalegre Oct 23 '21 at 02:47
  • wether you are able to mirror to chromecast is irrelevant i think, my previous suggestion war to see if the ADB driver on your Ubunto computer was in order as Darkman suggested. Your Pixels are probably working fine from what you have told us – quealegriamasalegre Oct 23 '21 at 02:53
  • See this: https://stackoverflow.com/questions/47230793/how-to-connect-pixel-2-to-adb – crazo7924 Oct 24 '21 at 04:03
  • @Darkman How do I do what you're suggesting? I tried simply updating them with apt upgrade but that had no effect. – FractalBob Oct 25 '21 at 18:14
  • Did the device get Android version updated? Likely because of faulty drivers. In that was the case, you'll have reflash the device to OEM state. Another thing might be the cause is worn out USB-C port. If so, then a replacement is the only option. Unless you replace it yourself it's cheaper to buy a used 2S/XL. – Darkman Oct 25 '21 at 19:50
  • connect your device to your pc. then (on windows) go to device manager>portabledevices>pixel2 right click pixel 2 and select update driver. if pixel 2 does not appear here there is probably an issue with the cable – quealegriamasalegre Oct 26 '21 at 02:30
  • @Darkman I doubt the problem is hardware-related on BOTH the Pixel 2 devices. – FractalBob Oct 26 '21 at 13:48
  • @quealegriamasalegre My laptop is running Ubuntu Linux, not Windows. Anyway, I doubt it's a cable problem since I tried 4 different cables. Also, as I mentioned, the problem only occurs on the Pixel 2; the Samsung Tab A, same Android OS, works fine. – FractalBob Oct 26 '21 at 13:49
  • yes but our main suggestion is that it is a driver problem. have you updated those? Im sure there is a way in linux to do this. in order to find your issue you should help us understand what is working and what is not working. does your ubuntu machine recognize the phones in general? are you able to explore the phones file directory on it? outside of android studio that is... do you have access to a different pc to see if android studio will recognize them there – quealegriamasalegre Oct 26 '21 at 17:24
  • drivers are often device specific (so there might be different ones for your Samsung tablet and your pixels) and if they are third party i think it might be that Ubuntu wont install/update them automatically – quealegriamasalegre Oct 26 '21 at 17:32
  • @quealegriamasalegre On Linux machines, you update all software with the command apt upgrade, which I had already tried. I didn't have any problem until I upgraded my Ubuntu OS, but that could be a red herring. I don't see how updating the OS could cause a problem only with Pixel 2s. – FractalBob Oct 27 '21 at 19:53
  • @quealegriamasalegre In response to your question about what is working re. phones, my old Samsung Note 4 phone connects just fine, as do all the emulated phones, including the Pixel 2s I tested. No, I can't see files on my real Pixels and I don't have access to any other computers. – FractalBob Oct 27 '21 at 20:00
  • Well to me it still sounds like a driver issue but from this post https://stackoverflow.com/questions/47230793/how-to-connect-pixel-2-to-adb it seems that you are not the first one with this issue. maybe you have already seen it. it might be worth a try to get through it – quealegriamasalegre Oct 27 '21 at 20:10
  • I have faced a similar issue in the recent past though I dont think you should set USB configuration to both File transfer and PTP as defaults. I think that should be left for the system to decide because several times I have connected my Pixel 4a to Android Studio and at the same time selected USB tethering mode to provide internet and it works perfectly well. – Emo Oct 29 '21 at 07:18
  • I have a Pixel 4a and faced a similar issue before i upgraded studio to Arctic fox. I thought it was just my pixel or the cable, but tried with a different phone and cable and it too was not seen by Studio. That's when I decided to 1. upgrade studio to Arctic fox but issue was still persistent, 2. Reinstalled my Win 10 Dell Inspiron laptop USB driver software (I suspected a virus had messed up some of my app settings) The machine also picked up updates and took a while installing them 3. Made sure Developer options and USB debugging are turned on and finally studio could see the devices again – Emo Oct 29 '21 at 07:20
  • @quealegriamasalegre I already updated the USB drivers for my Linux installation (the commands are sudo apt update followed by sudo apt upgrade) but that didn't help. – FractalBob Oct 29 '21 at 07:43
  • @Emo I tried your suggestion and set Default USB configuration to USB tethering and even rebooted, but that didn't help. – FractalBob Oct 29 '21 at 07:49

5 Answers5

2

You can hard reset your devices because in some cases that works.

Otherwise, You can use the developer options wirelessly on your phone. Just read this article for a step by step guide for how to do this.

Use Android device for development wirelessly

Abdul ahad
  • 1,383
  • 7
  • 18
0

are you using same usb cable for other devices in which it is working ?

try this once - open developer option and select 'Select USB Configuration' . make it mtp and also check if usb debugging is turned on.

M.K
  • 11
  • 4
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 24 '21 at 02:56
  • I already did what you suggested. – FractalBob Oct 26 '21 at 13:45
  • @shubham shah I tried to connect via wireless a long time ago, but no luck. – FractalBob Oct 30 '21 at 08:41
  • @m.k. Yes, the same cable works for my other devices, including the new phone I just bought. – FractalBob Oct 30 '21 at 08:45
0

Instead of doing it with a cable you could do it wireless just install the plugin adb wifi rest all the instructions are given when you will install that plugin.

Android WiFi ADB

Steps to do this(in short)

Connect your device to your computer using a USB cable. Then press the button picture of a button to be pressed on the toolbar and disconnect your USB once the plugin connects your device over WiFi. You can now deploy, run and debug your device using your WiFi connection.

NOTE: Remember that your device and your computer have to be in the same WiFi connection.

Shubham Shah
  • 147
  • 3
  • 6
0

Sometimes it happens for the USB connector manager of your operating system. You can uninstall the USB connector manager from your OS Device manager and then restart your laptop. I faced this issue several times and this solution worked for me.

aslamhossin
  • 1,217
  • 12
  • 22
-4

Try to install Genymotion Emulator and Launch it first before running your app. I did it and it helped me and i think it will be work