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?
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.
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.
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.
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.
Found the answer with the help of @pskink. "If" statements are "invalid" locales for breakpoints. See the checkmarks below:
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
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