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 :
And this :
I test it with emulator and physical device and also rebuild project and also restart idea ! but doesn't work.
Ctrl + F8 (Mac: Cmd + F8) Toggle breakpoint.
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.
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.
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.
Read these similar questions
Can't reach some lines debugging android app
Cannot set Java breakpoint in Intellij IDEA
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')
}
}
Follow the steps.
set the breakpoint on
your_view.setOnListItemSelectedListener();
and on if(...)
in OnListItemSelected
Did you by any chance activated ProGuard for your build? Try to turn it off. It may destroy your Breakpoints.
Also try:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With