Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ dont stop in breakpoints when debugging android application

I connect the debugger to my emulator and the idea console say :

Connected to the target VM, address: localhost:8612,transport:`socket` 

But when i want to test my app it doesnt stop in Break points ! See this screen shot :

enter image description here

And this :

enter image description here

I test it with emulator and physical device and also rebuild project and also restart idea ! but doesn't work.

like image 982
YFeizi Avatar asked Feb 18 '15 10:02

YFeizi


People also ask

How do I skip a breakpoint in IntelliJ?

Ctrl + F8 (Mac: Cmd + F8) Toggle breakpoint.

How do you ignore breakpoints?

To Disable All Breakpoints You can disable all breakpoints in one of the following ways: On the Debug menu, click Disable All Breakpoints. On the toolbar of the Breakpoints window, click the Disable All Breakpoints button.

How do you keep breakpoints?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.


4 Answers

First, make sure your IntellJ IDEA instance is up to date, there have been a couple of recent bugfixes related to this. (Ex: https://youtrack.jetbrains.com/issue/IDEA-81769)

Otherwise:

If android:process is set this may be your issue: https://youtrack.jetbrains.com/issue/IDEA-64456

Else you might have the problem described here: https://youtrack.jetbrains.com/issue/IDEA-95721

Unfortunately this second link lacks any sort of concrete help from the IntellJ team yet. One workaround is to use Eclipse for debugging temporarily, although that's a kinda awful solution.

like image 60
Others Avatar answered Oct 23 '22 11:10

Others


Read these similar questions

Can't reach some lines debugging android app

Cannot set Java breakpoint in Intellij IDEA

All your breakpoints can't works

it may be cause by code shrinking in your build gradle file, you can find it build.gradle(APP Name) in your project root directory. Make sure the minifyEnable under buildType is set to false.

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt')
    }
    debug {
        debuggable true
        minifyEnabled false // set this to false
        proguardFiles getDefaultProguardFile('proguard-android.txt')
    }
}

Some breakpoints can work, but some could not

Follow the steps.

  1. If you are using Maven dependencies, go to Maven Projects -> refresh
  2. If that does not work, Try top menu --> Build --> Rebuild Project
  3. If that still doesn't work, try top menu --> File --> Invalidate Cache/Restart
like image 23
Harlan Avatar answered Oct 23 '22 11:10

Harlan


set the breakpoint on

your_view.setOnListItemSelectedListener();

and on if(...) in OnListItemSelected

like image 29
dvs Avatar answered Oct 23 '22 10:10

dvs


Did you by any chance activated ProGuard for your build? Try to turn it off. It may destroy your Breakpoints.

Also try:

  • Build -> Clean Build
  • File -> Invalidate Caches / Restart
like image 20
dipdipdip Avatar answered Oct 23 '22 11:10

dipdipdip