Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breakpoints not working on Android Studio 3.3

Tags:

After upgrading Android Studio to version 3.3 this week, some breakpoints are not being recognized as valid, and are not stopping the thread.

Am I missing anything?

enter image description here

like image 762
Rafael Nascimento Avatar asked Jan 22 '19 15:01

Rafael Nascimento


People also ask

Why can’t I see breakpoints in Android Studio?

Sometimes due to Android Studio glitched, the breakpoint is not shown attached but could be okay. 3. Are you running on Debug Mode? Unlike iOS Xcode, in Android Studio, to debug your app, you’ll have to run it in Debug Mode. As shown in the diagram above, make sure you are running the app by pressing the Debug icon.

What happens if you run a breakpoint on a release build?

Technically, even if you run it on release build, it will still stop and break on your breakpoint. You might not able to watch the variable value or evaluate any expression properly. This is because by default the release variant is set to minify enabled, and proguarded (code if obfuscated). Check out this StackOverflow 5.

Why won't Android Studio start after upgrading to Android 11?

In the SDK Platforms tab, check the box labeled Show Package Details and select revision 9 or higher of the Android 11 emulator. If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin.

How do I stop a breakpoint from running in the background?

Hence when you put a breakpoint on the code that is run on the background, it will not stop. To ensure your breakpoint stop in all thread, go to your breakpoint setting (right-click on the breakpoint), set it to All instead of Thread as shown below. Check out this StackOverflow.


2 Answers

Found the answer with the help of @pskink. "If" statements are "invalid" locales for breakpoints. See the checkmarks below:

enter image description here

like image 85
Rafael Nascimento Avatar answered Sep 27 '22 22:09

Rafael Nascimento


The issue is in the build tool chain (gradle, d8/r8). Problem is fixed in Android Studio 3.4 Beta 1 with gradle 3.4.0-beta01.


Or a workaround solution for this issue can be used by locally updating the top-level build.gradle configuration for your project:

buildscript {
    repositories {
        maven {
            url 'http://storage.googleapis.com/r8-releases/raw' // ADD THIS.
        }
    }

    dependencies {
        classpath 'com.android.tools:r8:1.3.55'  // ADD THIS. Must be before the Gradle Plugin for Android.
        classpath 'com.android.tools.build:gradle:3.3'
    } 
}

Once the next point release of Android Gradle Plugins takes place these changes can be removed.


For more information, see: https://issuetracker.google.com/issues/122450679

like image 20
nhoxbypass Avatar answered Sep 27 '22 23:09

nhoxbypass