8

After updating my android studio from version 4.0 to 4.1 the debugger break points don't work anymore:

Screenshot

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Ahmed Nezhi
  • 190
  • 2
  • 12

6 Answers6

17

I had to rollback. No one has time for this sh**...

  1. Uninstall Android Studio
  2. Reboot
  3. Download & Install AS 4.0.2: https://redirector.gvt1.com/edgedl/android/studio/install/4.0.2.0/android-studio-ide-193.6821437-windows.exe or https://developer.android.com/studio/archive
  4. Change Gradle classpath to 4.0.2 in build.gradle

All better now...

Aace
  • 1,792
  • 16
  • 15
3

I would try the following:

  • Try the 'attach debugger' option with the app running, via the button on the toolbar, or finding the action (cmd/ctrl shift + a and type 'attach debugger to android process').

  • Make sure that debuggable true is set in your module/build.gradle for the flavor you are currently using, (Check the build variants tab).

  • Be sure that the Android Gradle Plugin points to the same version that Android Studio has, this is com.android.tools.build:gradle:4.1.0 for Android Studio 4.1.

  • Clear data, uninstall the app, and run 'Invalidate Caches & restart' from Android Studio.

  • Make sure you don't have the stable and the canary versions of A.S running (I faced debugger issues in the past because of that).

  • Restart adb? (adb kill-server && adb start-server).

  • Reboot / Switch the emulator / device?.

  • Reboot the computer?.

  • If all of the above fails, I would also try this script: https://github.com/rock3r/deep-clean

saulmm
  • 2,398
  • 15
  • 21
  • For what it's worth, I've been running into these troubles with 4.1 too. The only thing that seems to work consistently is the ``Debug app`` button (i.e. rerun the app with debugging enabled) - attach to debugger`` connects but just seems to ignore breakpoints half the time – cactustictacs Oct 16 '20 at 12:11
  • Thank you for the provided solutions. i tried but non of them worked, i had to change build.gradle`minifyEnabled false` && `shrinkResources false` in buildType debug. – Ahmed Nezhi Oct 16 '20 at 14:21
  • 1
    I'm in the same situation the interruption points don't work – Stênio Barroso de Moraes Oct 16 '20 at 23:50
  • 1
    It's a relief to know that placing breakpoints in 4.1 starts with a 9-step troubleshooting process. – Alexei Fando Oct 19 '20 at 20:41
1

In my case it only happens when debugging on the emulator. Debugging on a real device or unit tests works.

KaRa
  • 59
  • 7
1

Restart ADB in menú dispositives Android Studio

enter image description here

enter image description here

0

I'm using Android Studio 4.1. Following steps worked for me.

  • delete the .gradle folder in /.gradle
  • clean the project using Build > clean project
  • rebuild the project using Build > Rebuild project

Now try to debug the code.

I hope this helps!

0

In my case I added

debug {
    minifyEnabled true
    shrinkResources true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

in buildTypes of app level gradle. I just removed this and then I am able to debug. That's it.

Abraham Mathew
  • 2,029
  • 3
  • 21
  • 42