Android Debugger not Connecting

When I try to debug an android app I get an error. It happens after everything compiles and the app actually opens on the phone and says waiting for debugger.  Anyone know how to fix this? I do have CyanogenMod running on my phone if that makes a difference.  Below is the error.

Error Running Android App:
Unable to open debugger port: java.net.connectexception: "Connection refused: connect"

8 comments

Hello,

Please check that Android debug bridge sees the device: type "<ANDROID_SDK_DIR>/platform-tools/adb devices" in the command line. If it doesn't, then it's not a problem of the IDE. You need to make sure that USB driver is installed properly and USB debugging mode is enabled on your device

0

It shows up properly in the list of ADB devices.  I can also choose it when I go to debug or run the app from IntelliJ IDEA.  It then installs the app and starts it.  up to here everything is good.  Then on the phone I get a waiting for debugger message and I get the above error in IntelliJ IDEA.  I reall don't know why.

0

Ok, could you please create an issue in our tracker

0

Was a ticket ever created for this? I'm experiencing the same issue with IntelliJ IDEA 2016.3.1.

0

Hello Mozart,

Do you use any antivirus software?

 

0

Hi Yaroslavl,

Not really, no antivirus software here. My current settings as follows:

OS: macOS Sierra (10.12.1)

IDE: IntelliJ IDEA 2016.3.1 (Build #IC-163.9166.29)
JRE: 1.8.0_112-release-408-b2 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Running on debug mode works fine with Android Studio, with IntelliJ the debugger never connects. I have to run the app, and then after it's running I'm able to attach the debugger.

A bit frustrating if you need to set breakpoints for the app launch.

0

Hi Yaroslavl,

Sorry for the late reply. I've tried to use the workaround mentioned on that ticket but no luck. I'll do some search to see if I can find more information about the problem. Does IntelliJ uses a different version of Java than Android Studio?

Thanks for your help.

 

Cheers

0

Please sign in to leave a comment.