Android Studio 4.1某些断点不会触发 [英] Android studio 4.1 some breakpoint doesnt trigger

查看:139
本文介绍了Android Studio 4.1某些断点不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我的某些断点不会触发?我不确定这个问题何时开始,但是现在我在多个项目中都拥有它.

Why doesn't some of my breakpoints trigger? I'm not sure when this issue started, but I now have it in more than one project.

我有Android Studio 4.1,找不到新的更新.

I have Android studio 4.1, no newer updates that I can find.

我已使用 classpath'com.android.tools.build:gradle:4.1.0'更新到Gradle 6.5我尝试降级到4.0.2,还将Gradle更新到6.7和其他变体.所有这些都没有任何作用.

I have updated to Gradle 6.5 with classpath 'com.android.tools.build:gradle:4.1.0' And I have tried downgrading to 4.0.2 and also updating Gradle to 6.7 and other variations. All this without any effect.

在上面的两个图像中,我有断点,它们在同一个Java文件中.第一个触发并停止执行.第二个不会触发并停止执行.我知道第二张图片中的代码会运行,因为在测试期间,我在其中添加了一个祝酒词,并且在我运行应用程序时显示了祝酒词.

In the two above images I have breakpoints, they are in the same java file. The first one triggers and stops execution. The second one doesn't trigger and stop execution. I know the the code in the second image runs, because during my tests I added a toast there and that toast was shown when I ran my app.

该应用程序运行正常,我只是无法调试其中的某些部分.

The app runs as expected, I just cant debug some parts of it.

所以现在我不知道还要测试什么!非常感谢您的帮助和提示!

So now i don't know what else to test! Help and tips are very much appreciated!

更新:我尝试了一些奇怪的事情.我从屏幕快照2中的方法内部创建了一个新方法.如果在新方法中设置了一个断点,它将触发!!!我已经注意到,不会触发的断点在其中没有一点勾号,我认为这很重要.那么,这意味着什么,我是否需要在所有侦听器中都使用其他方法才能进行调试?

Update: I tried something weird. I created a new method from inside the method in screenshot 2. If I set a breakpoint in the new method it triggers!!! I have noticed that the breakpoints that don't trigger don't have the little checkmark in them, I assume that the mean something. So what does this mean, do I need extra methods in all my listeners just to be able to debug?

推荐答案

在使用 Gradle插件v4.1.1 Gradle版本6.7 <升级到Android Studio 4.1.1时,它再次开始工作./code>所以我想这是Android Studio 4.1的错误

It started working again when updating to Android Studio 4.1.1 with Gradle plugin v4.1.1 and Gradle Version 6.7 So i guess it was a bug with Android Studio 4.1

这篇关于Android Studio 4.1某些断点不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆