Unable to attach debugger to Android process in Android Studio 2.3.3

Viewed 2443

I have searched the internet and tried everything I have come across, but I cannot figure out what I am doing wrong. I cannot attach the debugger to my Android process in Android Studio.

I have built an app in Android Studio 2.3.3 on a virtual machine using VirtualBox and running Ubuntu 16.04.2. I have installed the app on my device, a Getac Data Logger, and have noticed that my app opens for a couple of seconds, displaying a blank white screen, and then crashes. So, I have attempted to debug the app on my device to find the problem. When I click on the "Attach debugger to Android process" icon, I can see my device as an option, however, when I select my device the OK button is grayed out. There is no way for me to move forward with this process. Sometimes the warning "debug info can be unavailable, please close other application using ADB: Monitor, DDMS, Eclipse" pops up, but not every time.

Does anyone have any ideas as to what I am missing? Does it have something to do with the limitations of working on a virtual machine?

Things I have tried:

  • Making sure I have allowed USB debugging on my device

  • Selecting all kinds of combinations of show all processes/auto/java/etc

  • Commands: adb kill-server, then adb start-server; adb kill-server, then adb -P 5038 start-server

  • Waiting to plug in my device until I launch the debugger attachment

  • Building debug variant

  • Adding android: debuggable="true" to my application in my AndroidManifest.xml, then noticing it was not necessary after building the debug variant and taking it back out

  • Disabling and re-enabling the ADB integration through Tools/Android/Enable ADB integration

  • Closing Android Studio and then opening it again

  • Changing the adb port

  • Invalidating cache/restart

  • Uninstalling the app, clean build, reinstalling the app

  • Installing the MTP using the command: apt-get install mtpfs. It says that mtpfs is already the newest version, but the Ubuntu error "Unable to open MTP device '[usb:001,021]'" does persist, just not always.

  • Revoking USB debugging authorizations, exiting out of Android Studio and my VirtualBox, rebooting everything, and setting it all up again.

PLEASE NOTE:

  • I am brand new to development (a little over a year experience in web development), brand new to app development (this is the very first app I am creating), brand new to Android Studio (again, very first app).

  • My device is showing up in the debugger as an option. It is just that the OK button is grayed out, no way to move forward.

  • I do NOT have Eclipse or Monitor (and therefore not DDMS either) running.

EDIT: I have noticed that "#com.android.ddmlib - Adb rejected connection to client '[numbers]': closed" is showing up in my terminal several times with several different number combinations. Not sure what this means. Perhaps I am running DDMS? I thought that was something that runs through Monitor?

2 Answers

I had intellij Idea IDE and Android Studio 4 Canary were open with Android projects at the same time, after closing both the IDEs and opening only android studio, I was able to attach the debugger to the app process.

Related