6

I am having trouble enabling wireless debugging in Android Studio. In fact when I select "Pair Devices using Wi-Fi" I get an almost instant error with the very general (useless) message "unexpected error during Wi-Fi pairing initialization". I was very surprised being that I was unable to find any posts or pages when googling for that specific message!

Android Studio proides a "learn more" link that opens up this page and is basically useless - it describes basic steps which I will copy below. I can't find any logs or more specific error messages. Tried rebooting PC, restarting AS, turning off any firewalls/anti virus, trying with phone plugged in (USB debugging works fine, I can load apps to the phone when plugged in no problem), adb restart, updated AS and SDK platform tools. Nothing changes, same message (see screenshot at the bottom).

What bugs me is that because the error message pops up almost instantly, the whole "service" seems to be unable to start completely. I have researched extensively, but most errors are quite specific and deal with network/IP issues or pairing problems etc - but all those are AFTER some initial steps do take place.

I am running Android Studio Dolphin | 2021.3.1.

I have a Samsung s21FE running Android 12 (although i don't think that is even relevant, it never starts looking for devices anyway)

I have followed all steps in relevant guides, for example here, namely:

  1. Ensure that your workstation and device are connected to the same wireless network.
  2. Ensure that your device is running Android 11 or higher. For more informaton, see Check & update your Android version.
  3. Ensure that you have Android Studio Bumblebee. You can download it here.
  4. On your workstation, update to the latest version of the SDK Platform-Tools.

the error I see is this:

I would be grateful for any help ...

EDIT: I solved it by following a suggestion from the comments submitted on this post, see below.

enter image description here

thomas
  • 126
  • 1
  • 6
  • 1
    Have you tried pairing your device using adb from terminal using "adb pair your_ip:your_port" ? – Mirco0 Sep 15 '22 at 20:27
  • directly on wifi you mean, or while usb connected? – thomas Sep 15 '22 at 20:28
  • While connected on wifi – Mirco0 Sep 15 '22 at 20:29
  • i will try and report what happened. thanks. – thomas Sep 15 '22 at 20:30
  • I did connect wirelessly with adb connect 192.168.1.6:5555. Followed advice from here: https://stackoverflow.com/questions/42992965/how-to-connect-to-your-device-from-terminal-using-adb-commands And I see: List of devices attached - 192.168.1.6:5555 device However nothing changes within android studio. – thomas Sep 15 '22 at 20:37
  • 1
    If you re connected with your device now you should be able to use it to run the app – Mirco0 Sep 15 '22 at 20:39
  • Yep, it worked! Thanks!!! I now see two devices (one with the ip) and indeed when I disconnect the USB able, one device remains connected (through wifi I guess) and app does install wirelessly. Thanks a lot buddy .. I guess an AS bug through its UI ? – thomas Sep 15 '22 at 20:42
  • I never used the ui to connect/pair inside android studio so I can't tell if it's a bug, glad to be helpful – Mirco0 Sep 15 '22 at 20:44
  • I had the same issue after updating to dolphin and being in a new wifi network. At first I thought it may be a bug in dolphin. Starting pc and mobile device new solved my issue. – memres Sep 26 '22 at 06:30
  • You need to disable & re-enable adb mDNS from Android Studio, see: https://stackoverflow.com/questions/70944858/android-studio-bumblebee-wifi-pairing-issue – MrX Feb 25 '23 at 06:34

4 Answers4

10

Try upgrading the SDK Platform tools in Tools > SDK Manager > SDK Tools.

SDK manager

raphaelmerx
  • 396
  • 1
  • 7
1

I have fixed this problem by closing Android Studio and opening it again.

Rakibul Islam
  • 61
  • 2
  • 4
0

I have fixed this problem by restarting the PC.

0

use this command in terminal:

adb connect <YOUR_IP>:5555
  • Answer needs supporting information Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](https://stackoverflow.com/help/how-to-answer). – moken Jul 13 '23 at 15:36