YFeizi
YFeizi

Reputation: 1528

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.

Upvotes: 15

Views: 1507

Answers (5)

Harlan
Harlan

Reputation: 847

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

Upvotes: 3

dipdipdip
dipdipdip

Reputation: 2556

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

Upvotes: 2

Wackaloon
Wackaloon

Reputation: 2365

There're message "Suspend all" in info about breakpoint, it means that IDE will skip all breakpoints, you need to turn it off (usually somewhere in debugging window there is a button to suspend breakpoints)

Or maybe it's build type. Did you check your build, is it debug?

Upvotes: 1

Others
Others

Reputation: 3013

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.

Upvotes: 6

dvs
dvs

Reputation: 644

set the breakpoint on

your_view.setOnListItemSelectedListener();

and on if(...) in OnListItemSelected

Upvotes: 2

Related Questions